pp108 : registerUIComponent()

registerUIComponent()


It registers a control to the model. After the component gets registered to the model, it becomes a view for the model. If a valid reference is set for the component, model data will be bound to the component.

Syntax

Script

oView = modelID.registerUIComponent(oComponent)

Parameters

Parameter

Description

oComponent

Object that denotes the component which has to be registered to the model.

Return Value

Returns the view created for the component.

Remarks

The component specified can be a primitive control like an Input control or a grouping control like Groupbox containing controls within it. In case of grouping controls, all the controls within them are considered to be the consumers of the current model unless they are registered to a different model explicitly.

Example

  1. Drag and drop a Web service into an XForm designer to create a model. You can also include the SOAP request in the XML editor as shown below:
     Request xml to be placed in the XML Editor.
     This request is set to the Get method by setMethodRequest().
    <xml id="employeesRequest">
        <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
             <SOAP:Body>
                  <GetEmployees xmlns="http://schemas.cordys.com/1.0/demo/northwind">
                      <cursor numRows="5"/>
                      <fromEmployeeID>1</fromEmployeeID>
                      <toEmployeeID>3</toEmployeeID>
                  </GetEmployees>
             </SOAP:Body>
        </SOAP:Envelope>
    </xml>
  2. To synchronize data, call the method directly as shown below:
    newModel.getDataset();
  3. If you create the model through an XML request, set the XML document as the method request and synchronize the data.
    //Set and fire request
    newModel.setMethodRequest(employeesRequest.XMLDocument, "Get");
    newModel.getDataset();

    Applies to

    Model