0
votes

I created a Dialog , when I launch the Dialog I want to assign a value for field.

I have this code:

Dialog dialog;

myDialogField = dialog.addField(enumStr(myEnumType));
myDialogField.value(myVariableEnum); 

dialog.run();

With this code I can not assign variabe. I launch the Dialog by button on Form , in a class I saw the really value in myVariableEnum but I don't know how to assign.

Thanks all,

enjoy!

1
The value assignment should work, but your code seems to be incomplete because the dialog variable is never instantiated. - FH-Inway

1 Answers

2
votes

Your dialog needs to be instantiated as FH-Inway pointed out, but you also need to use the field.value() as a getter to use the fields value after you run the dialog:

Dialog dialog;
DialogField myDialogField;

dialog = new dialog();
myDialogField = dialog.addField(enumStr(NoYesError), "Values : ");
myDialogField.Value(NoYesError::Yes);

dialog.run();

info(myDialogField.value());//This gets the value of the field after the dialog is run.

Resulting dialog box