executing a screen action, does the prepariton action always occurs?

executing a screen action, does the prepariton action always occurs?

  
when executing a screen action, for example thru a button, what´s the diference between ending the same with the page it self or an END?

And wy does the page execute prepariton even when i use ajax in that same action triggered by the same button?


best regards
Hi João,


Everytime your screen Action terminates with an End element, it means the page will maintain all its context, that is, all the variable values will be remembered and accessible in subsequent requests. Now, if your Button Method property is set to Submit, the Screen Preparation will be executed again. If your Button Method property is set to Ajax, the Screen Preparation will not be executed.

When your screen Action terminates with a Destination element (either to the same page or another), it means you will loose all the context, that is, all the variables will be reset to their default values and the page will be rendered again from scratch. In this process, the Preparation is executed again.

For more information on this topic, please check the following Service Studio's documentation pages:
Hope this clarifies,

Rodrigo Castelo


P.S.: If your Button Method property is set to Ajax and the Preparation is executing, as you state, this is a bug. Please submit this to support@outsystems.com so that we can take a look into it and fix the problem.
hi Rodrigo,


Thank you for your help, but it seems that there is still a problem with the method ajax. I´ve got a button wich method is Ajax, and when i execute the action screen prepararation still occurs, if the terminal scope of the action is the same page! It seems that AJAX method only works when combined with END as terminal scope in the action. Is this correct?

Best regards

Thanks
Exactly João.

When you use a Destination to terminate the Action you are saying you want to get rid of all the Screen context and render it again from scratch. Hence, independently of being Ajax or not, the Screen Preparation must be executed, otherwise the screen would display no data.

If you want to keep the Screen context (all the variable values) and only change a part of it, then you must use Ajax and terminate the Action with the End element.

Cheers,

Rodrigo Castelo