Combobox changed value to enabled Confirmation Message

So I have this combobox where onChange to ID = 2, the Submit Button onClick will pop a confirmation box, otherwise no confirmation box.


here is the code in Confirmation Box of the Submit button:

If(IdentifierToInteger(Form1.Record.Record.ID) = 2, "Are you sure?", "")


And I also add an action where onComboBoxChange it will ajax refresh the button container.


But it doesn't seem to take the value of the combobox since when I debug the submit button takes Form1.Record.Record.ID = 0

I also tried to other workaround such as creating a new local variable to contains the change of combo and when it is =2, the local variable will become true and allow the confirmation box to happen.


But either ways did not work... any ideas on what the issue is?

Hello Stephen,

I believe when working with a combobox you need to designate a variable that stores the selected value (field "Variable" in combobox properties). Thus I am not sure if "Form1.Record.Record.ID" ever holds the value you are looking for, unless that is the designated variable. Have you tried using the designated variable instead of "Form1.Record.Record.ID"?

Otherwise it might be helpful for you to share a sreenshot of the combobox property window and / or a *.oml file containing the problem with us.

Best regards,
Michael

Hi Stephen Li,

One solution for you to use the confirmation message is:

In the OnChange of your ComboBox,
you put an if, and when you get the code you want, you run a javascript with the RunJavaScript ("document.getElementById ('Button.Id'). click ();") and click on a button that is with the style "display: none;" on your screen, and on the button, you put the confirmation message.

I hope to help

Bernardo Condé wrote:

Hi Stephen Li,

One solution for you to use the confirmation message is:

In the OnChange of your ComboBox,
you put an if, and when you get the code you want, you run a javascript with the RunJavaScript ("document.getElementById ('Button.Id'). click ();") and click on a button that is with the style "display: none;" on your screen, and on the button, you put the confirmation message.

I hope to help

Thank you for the workaround. I would take that as the last resort. I would like to have a better understanding of the issue here before I dig into using a javascript to bypass the problem. But thanks a lot for your suggestions beforehand!

Michael Segbers wrote:

Hello Stephen,

I believe when working with a combobox you need to designate a variable that stores the selected value (field "Variable" in combobox properties). Thus I am not sure if "Form1.Record.Record.ID" ever holds the value you are looking for, unless that is the designated variable. Have you tried using the designated variable instead of "Form1.Record.Record.ID"?

Otherwise it might be helpful for you to share a sreenshot of the combobox property window and / or a *.oml file containing the problem with us.

Best regards,
Michael

Hi Michael,

The "Variable" attribute of the combobox actually uses "Form1.Record.Record.ID", what do you mean by designated variable? I also tried to use a local variable instead but either of them catches the change of value of the combobox.

Stephen Li wrote:

Michael Segbers wrote:

Hello Stephen,

I believe when working with a combobox you need to designate a variable that stores the selected value (field "Variable" in combobox properties). Thus I am not sure if "Form1.Record.Record.ID" ever holds the value you are looking for, unless that is the designated variable. Have you tried using the designated variable instead of "Form1.Record.Record.ID"?

Otherwise it might be helpful for you to share a sreenshot of the combobox property window and / or a *.oml file containing the problem with us.

Best regards,
Michael

Hi Michael,

The "Variable" attribute of the combobox actually uses "Form1.Record.Record.ID", what do you mean by designated variable? I also tried to use a local variable instead but either of them catches the change of value of the combobox.

Hello Stephen,

by designated variable I mean the content of the variable property. Just from your original description it wasn't apparent to me that you are already using "Form1.Record.Record.ID" as that variable, since forms also auto-assign some variables that aren't always used. As mentioned before, it would probably be easier if you could share a screenshot or *.oml file with an example.

Anyway, I tried to rebuild a simple example from your description myself to see the problem in action and found it to be working fine. I have added my *.oml for you to take a look. The example only contains a ComboBox inside a Form with 3 options, a Button with your condition from above, the site's Preparation (to populate the Form) , an OnChange screen action for the ComboBox and an empty screen action that's called by the Button. When you select "Record3" (which has Id = 2) in the ComboBox and press the Button, your confirmation dialog pops up.

Without seeing the problem firsthand, that's the best I can do without resorting to guesswork (again).

Best regards,
Michael