Combobox set to default in AJAX Submit

Combobox set to default in AJAX Submit

  

Hi,

I am applying AJAX submit for my button.

My screen are as per below with all combobox.

My issue is that how to clear all the selected value in the combox to "-" after user click submit button.

I have try to refresh the form using AJAX.But the value is still there.

I have tried to clear the variable which is attached to the combobox.But it cannot be done because it is identifier.

Does anyone has idea on this?Help!!

Solution

Hello Johnson,

Refresh the form "per se" will not do what you want, because it will not fetch data from the source (again). And it will just render itself using the data in its record. So if you are using the form record variables to bound to the inputs/combo boxes, the values there will be used.

What you need is to restore original values for the variables bounded to the combo boxes.

If your combo boxes are bounded to the form record attributes and you want to zeroe your form, just create a local variable that has the same type as the source of the form (do not put any values in it), call it empty (for example), and assign it to the form record in your ajax method (literally, form.record = empty). Than refresh the form and the new values will show up.

If you don't want to zeroe the entire form, but only the combo boxes, or if the combo boxes are bounded to other variables than those from the form's record, than you need to explicitly set their values using assigns prior to refresh the comboxes/form.

Cheers,
Eduardo Jauch

EDIT:

Example: https://eduardojauch.outsystemscloud.com/ClearForm/Entity1Detail.aspx?Entity1Id=0&(Not.Licensed.For.Production)=

See attached file.

Solution

thanks Eduardo

You're welcome :)