Data handler

DataHandler is the layer between the GUI and the web service. The handlers expose the web service results (the carriers) to the GUI and take care of sending the modified results back to the Web services when needed.

For example, if we require contact details, the data handler gets a request from the PageBuilder for the Contact entity and has to call the web service to get the answer.

A data handler handles the population and storing of data within a card. The controls can bind to this data through the datasource property. It’s the glue between the UI and NetServer.

In the SoContactPage.config file, it states the datahandlers and the panels it is using.

<page id="ContactPage">
  <data>
    <datahandlers>
      <!-- Some other code-->
      <datahandler id="ContactEntityDataHandler"
      type="ContactEntityDataHandler"></datahandler>
      <!-- Some other code-->
    </datahandlers>
  </data>
  <panels>
    <panel reference="Menu" />
    <panel reference="ButtonBar" />
    <panel reference="Navigator" />
    <panel reference="Contact" />
  </panels>
</page>

ContactEntityDataHandler

The ContactEntityDataHandler data handler is called in the Contact panel. The following code segment shows the SoContactPanel.config file.

[!code-xmlXML]

The ContactEntityDataHandler will fetch the ContactEntity from the web service. With the statement below, we use the name of the handler to retrieve the data (create object) from the carrier.

[!code-xmlXML]

The PageBuilder framework rendering mechanism gets the data onto the page by using data handlers.

How-tos and tutorials