Refreshing with Ajax Processes

Top  Previous  Next

If there is a need to execute a number of processes (e.g. RelDBUpdateProcess, SendTextMailProcess, etc) before refreshing the parts of a page with Ajax then an ajaxProcessCommand element should be configured in the MoreMotion configuratioon.

Ajax Command Configuration:

<ajaxProcessCommand name="FormName.CommandName">

   <processTemplate name="processTemplateName"/>

   <debugLevel>[1|2|3]</debugLevel>

</ajaxProcessCommand>

The name attribute of the ajaxProcessCommand element should contain the name of the Process Form that this command is located in and the name of the command itself using the notation FormName.CommandName.

Nested Elements

processTemplate (Accepts MScript)

The name attribute of this element must specify the configuration name of the processTemplate element . See Addressing other configuration elements. MScript can be used in the name attribute. e.g. <processTemplate name="@vof(s:template)" />

The processes including the Ajax refresh processes should be configured in the processTemplate element that is addressed with this element.

 

debugLevel (Accepts MScript)

Assign a value between 1 and 3 to debug the execution flow of the Process Manager. The debug records printed by the Process Manager can be traced from the system console.

 
Process Command

To submit a Process Form with Ajax, a ProcessCommand element must be included into the Process Form as follows.

<input name="__pcommand" type="button" value="RefreshProducts"
        onclick="if (AjaxMgr.submitProcessForm(formName:'PForm',commandName:'Refresh' ,'' ) == false) return false;"
        mo:name="Refresh" mo:type="ProcessCommand"

        mo:props="requiredBlocks:'ProductsBlock,', validateInput:true,

                  confirmMessage:'Are you sure?', beforeSubmitFunc:CallMeBeforeSubmit "

/>

 

See AjaxMgr.submitProcessForm() in  MoreMotion Face API.

 

In a processTemplate configuration, Ajax refresh processes are usually take place at the bottom after the other processes. Refreshing the page parts with Ajax refresh processes is more flexible and efficient since one or more Ajax processes can be included in the execution list of a processTemplate thus different type of elements on a page can be refreshed with one single request.

 

Ajax Refresh Processes

RefreshFieldsProcess

RefreshOptionsProcess

RefreshBlocksProcess

RefreshAreasProcess

CustomRefreshProcess