2

Is there any way to do that?

I mean, if the form fullfill specific conditions setVisible true or false to a control in the form? Or if i check a CheckBox, show some specific ComboBox?

Thanks in advance for your help

1
  • sure, you can do it by code why not.
    – Tassisto
    Oct 29, 2013 at 12:20

2 Answers 2

3

I would recommend enabling and disabling fields, rather than hiding them.

Open a Supplier, and on the Invoice and Delivery fast tab choose select the Calculate withholding tax CheckBox. This is the VendTable form. The Calculate withholding tax control will enable and disable a second control depending upon the value selected.

VendTable.TaxWitholdCalculate

The second control has it's property AutoDeclaration set to Yes, and the event that fires the change can be found on the forms VendTable data source. Find the relevant field (VendTable > Data Sources > Vend Table > Fields > TaxWithholdCalculate) and notice that the modified method has been overridden, changing the control's enabled property. It also has a visible property should you want to remove it from view.

VendTable.TaxWitholdCalculate2

Top Tip: In case that you are not aware, you can right click on any control on a form and choose the Personalise option from the context menu. From there is a form which contains a very useful box called System name. You can find the name of the control/table field from this.

VendTable.TaxWitholdCalculate3

3
  • "I would recommend enabling and disabling fields, rather than hiding them." Totally agree with that. The main reason for this is that when you dynamically hide / show controls, your form will shift controls due to Morphx handling layout of fields in groups. Oct 20, 2013 at 8:31
  • @KennySaelen so you're saying that MorphX can't handle it well?
    – Tassisto
    Oct 29, 2013 at 12:19
  • "I would recommend enabling and disabling fields, rather than hiding them." I would say in 99% of situations I have seen there has been a very good reason for hiding a UI field. Nov 4, 2013 at 8:40
0

I suggest you this solution for your second problem:

if i check a CheckBox, show some specific ComboBox?

I assume your form is complete (it has all controls needed : comboboxes, checkboxes, etc). And the controls AutoDeclaration-property is set to 'Yes'.

  1. In the AOT expand the Form till you find the CheckBox, expand it as well
  2. Right-click its Methods and select 'Override method' >> 'Clicked'
  3. Finally you can add this code and save/compile the form: myComboBox.visible(true);

It should look like:

public void clicked()
{
    super();
    myComboBox.visible(true);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.