pp108 : reset()

reset()

When you are unsure of which of the methods (whether previous or next) needs to be executed first, you can use the reset() method. This method decides the right method to be called during runtime and invokes it accordingly (particularly in situations when one is not sure of calling either the getDataset() or getNextDataset() method).

Syntax

Script modelID.reset()

Return Value

No value is returned.

Remarks

This method can be called once all the requests are set to the model. Execution of this method refreshes all the view of the model.

Sample Code

  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

Related reference

setMethodRequest()
Retrieving Data For Models
Model