|
Best of Support |
|
|
Conditional appearance of sub-Dialogs |
|
Issue
Lets say, for example, I have a Dialog called Billing. In this Dialog I have two fields. The first field is a drop-down box with the different types of Billing rates, for example:
Normal (Default Rate) - Hourly
Flat Fee ($0.00 Time) - Hourly
The second field is a sub-Dialog. I would like the sub-Dialog to be different depending on the selection from the drop-down box. If I pick Normal from the drop-down box I want the sub-Dialog to show Dialog.NormalDefaultRate, but if I pick Flat Fee, I want the sub-Dialog to be Dialog.FlatFee.
Solution:
In the GhostFill Dialog Editor, click in the drop-down box field, and then click the Edit Events button on the toolbar. The GhostFill Dialog Event Editor opens. In the OnChange event you can add script that will dynamically change all sorts of properties and values of the entire Dialog set.
For example, if you had different sub-Dialogs for different billing scenarios you could add the following script to the event:
%[IfTrue(ThisDialog.Billing="Normal",
ThisDialog.Form.Fields.NormalDefaultRate.Visible=True,
ThisDialog.Form.Fields.NormalDefaultRate.Visible=False)]
%[IfTrue(ThisDialog.Billing="Flat fee",
ThisDialog.Form.Fields.Flatfee.Visible=True,
ThisDialog.Form.Fields.FlatFee.Visible=False)]
etc.
Or if you had just one sub-Dialog, you might want to set values or properties within that sub-Dialog, based on your selected billing rate, for example:
%[IfTrue(ThisDialog.Billing="Normal", ThisDialog.NormalDefaultRate.Current="Normal")]
or
%[IfTrue(ThisDialog.Billing="Normal", ThisDialog.NormalDefaultRate.Form.Fields.Normal.Visible=true)]
etc.