[SOLVED]AjaxProcessing does not change value with 2nd field

Hello,

  1. Field Country
  2. Field Region

When I activate AjaxProcessing with Field 1 to refresh Field 2, this works fine on the fly. The form changes what is presented to the user. But the internal values cause problems.

The {Field Country} value with Field 1 changes to new value, but {Field Region} value with Field 2 stays the same. Same when I try to save Field 2 as a [variable]. Both values do not get updated before an OnChange event with Field 1 even though the form displays a new region name with Field 2 based on what I picked with my Field 1.

Not sure if this is the correct behaviour, but it would make it impossible to write a code OnChange with Field 1 based on new values with Country and Region.

Note: Did some more testing…it looks like the value with Field 2 is always one step behind…and some Ajax Processings are done before OnChange code runs and some are run after…

1.Field Country (AjaxProcessing Refresh Field Region and Timezone)-Type Select
2.Field Region (AjaxProcessing Refresh Field Timezone)-Type Select
3.Field Timezone-Type Select

This is what happens when I change Country:

a)Region refreshes what is being displayed, but internal value with region stays the same (also when I save a variable with field)
b)OnChange Code with Country runs, but can only use the old values of field Region
c)Timezone field SQL Select Statement runs
d)Now the value with field Region changes to new value

Re: AjaxProcessing does not change value with 2nd field

Actually the AjaxProcessing should follow these steps:

1.COUNTRY (AjaxRefresh with 2 and 3)-Type Select
2.REGION (AjaxRefresh with 3)-Type Select
3.TIMEZONE-Type Select

When I change Country…

-run all depending sql (with new country value)
-get all new values
-run OnChange with Country
-get all new values
-run all depending sql
-get all new values
-run OnChange with Region (if value has changed)
-get all new values
-run all depending sql
-get all new values
-run OnChange with Timezone (if value has changed)
-get all new values
-run all depending sql
-get all new values

I guess

Re: AjaxProcessing does not change value with 2nd field

I thought about this issue…with field of type select there is this really nice option to reload or refresh the form…actually this refresh is really pretty because the form does not disappear for a second while fields are refreshed and the browser window stays where it is. Maybe you could provide a macro that we can use to refresh form or even a single field OnChange Ajax Event so we can catch the new and refreshed values with the code the follows OnChange Ajax Event.

Best way would be, if SC has new values right away so we can work with those OnChange Ajax Event.