pp108 : rebind()

rebind()


This method is available for controls that are bound to a model. In case of a parent control that is bound to a model and contains child controls, the rebind() method is available only for the parent control, which is directly bound to the model. It is not available for controls that are bound to a model through a parent control.

This method refreshes the control with the data from the business object that is passed as a parameter. If no parameter is passed, then the business object of the active Tuple in the model is taken and the control is refreshed.

Syntax

Script ControlID.rebind([obusinessObject])


Parameters

Parameter Description
obusinessObject This is an optional parameter. Object that denotes the business object with whose data the control should be refreshed. If the parameter is not found, then the control will be refreshed with the data from active Tuple of model.


Return Value


No value is returned.

Remarks


This method can be used to refresh only data-bound controls.

Example


The following example shows how this method can be used.

//Assume EmployeesModel is the model, whose active business object is to be edited
   var businessObject = EmployeesModel.edit();
//Change any data inside the business object e.g. first name
   WebForm.setNodeValue(businessObject, "FirstName", "some value");
//Rebind the change, for example, table1 is the control
   table1.rebind(businessObject);

Applies to


All controls