RefreshBlocksAction

Top  Previous  Next

RBA_icon
 
RefreshBlocksAction is used to form a AjaxMgr.refreshBlocks() call definition. With this call the records of one or more process blocks can be refreshed. The numbers of the target blocks and the data source names must be equal.

Important: The "Manipulate Records" properties of the target process block elements must be set to "true".

See RefreshBlocksProcess

RefreshBlocksAction
 

Properties

Data Source Names (dataSources) (Separated with commas, Accepts MScript)

The names of the data source elements separated with commas.

 

Nodes To Encrypt (nodesToEncrypt) (Separated with commas, Accepts MScript)

The names of the nodes (separated with commas) whose values to be encrypted. If more than one data source is used then the nodes belonging to the different data sources should be separated with a semi-column.

 

Target Blocks (targetBlocks) (Separated with commas, Accepts MScript)

Target blocks elements to refresh. It can be a single String that contains the HTML ids of the target elements separated with commas or an Array of elements.

 

Note: The "Manipulate Records" properties of the target process block elements must be set to "true".

Field Map (fieldMap) (Separated with commas, Accepts MScript)

By default, the values of the process fields in the specified process blocks are refreshed with the values of the identically named data nodes. If there are exceptions to this rule it can be specified with this parameter in processFieldName:dataNodeName,[processFieldName:dataNodeName ...] format.

Example: ORDER_ID:ID,UNIT_PRICE:PRICE

 

Request Parameters (requestParams)

The parameters and their values. The initial value "{p1:'p1val', p2:'p2val'} ?" aims to show the definition syntax and if no update is made to it, it is ignored in the output.

When defining this property, it is important in which element the generated call definition is used. For example the this word in "{ID:this.value}" definition represents the HTML element object that the generated call definition is used in, not this action element itself.

 

Busy Image (busyImage)

The HTML id of a BusyImage element that exists in the page.

 

CallBack Function (callbackFunc)

The Javascript function to be called after the target blocks are refreshed. The function receives a MultiPartAjaxResponse object as the parameter

 

User Data (userData)

The user data object defined with this property is passed to the response handler and the callback function.

 

Error Handler (errorHandler)

The name of the function to be called when an error occurs. The function receives Exception and AjaxResponse objects as the parameters.

 

 

The calling the AjaxMgr.refreshBlocks() function

 

Dynamic Call Definition
 
On the context menu that pops up when an action element is right clicked, the following options are displayed. If the option 'Copy "Dynamic Call Definition" to Clipboard' is selected, a dynamic call definition is formed and copied to the Windows clipboard.

 

DynamicCallDefinition

 

The copied definition can later be pasted into the event properties of the elements or into the "Embedded Script" properties of the Script elements.
 
Example:
 

%vof(/myRefreshBlocksAction/jscall)

 

The actual AjaxMgr.refreshBlocks() call is generated during the compiling of the page by expanding the %vof(??/jscall) definition.

 

 

Function Call

 

The second "Copy to clipboard" option on the context menu is used for that. When the 'Copy "Javascript Function Call" to Clipboard' option is selected, AjaxMgr.refreshBlocks() call definition is formed immediately with the current values of the properties and copied to the Windows clipboard.

 

The call definition copied to the clipboard can later be pasted into the event properties of the elements or into the "Embedded Script" properties of the Script elements.
 

Example:

AjaxMgr.refreshBlocks({
  actionName     : 'myRefreshBlocksAction'
  ,targetBlocks  : 'ProcessForm1.ProcessBlock1,ProcessForm2.ProcessBlock2'
  ,requestParams : '{NO:this.value, KATEGORI_NO:this.value}'
  ,busyImage     : 'BI1'
  ,callbackFunc  : showMessage
  ,userData      : {message:'Records updated.'}
  ,errorHandler  : myErrorHandler
})

 

Warning! In contrary to the dynamic call definition, the changes made to the properties after the function call copied, will not be effective.