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!
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.