Parent Widget Data Path

A widget (screen) can be created and used as a sub widget in any other widget (which we can call as a "Parent widget"). To use the data of the "Parent widget" in this sub widget, "Parent Widget Data Bean Path" needs to be specified in the sub widget.


Use this functionality when you want to create multiple reports in an application where the SEARCH filter criteria is the same. Assuming that Location is the common search criteria for all the reports, create one screen (widget) where a Location combo box is present. You have to select locations registered in the system.

You can create multiple widgets for multiple reports, where the above widget is used as a sub widget. For creation of widgets, see CREATE WIDGET.


Set "Parent widget data path" in the sub widget as follows

Steps:

  1. In the sub widget properties, click Data Mapping.

  2. In the Data Path property, specify data as follows:

    $widget.parentWidget.dataBean

  3. Click SAVE.


To get data from the Parent Widget in this sub widget

Steps:

  1. Right-click the Location combo box and click the OnChange event.

  2. In the After Processing Script property, write the following script:

    var params = source.getWidget().getParentWidget().getDataBean();
     
    var location = params.locationid; // (locationid is data mapping field of Location combo in sub widget).

  3. Click SAVE.