+

Search Tips   |   Advanced Search

Interaction between widgets and portlets by shared render parameters


In client side rendering mode, the portlet concept of public render parameters is mapped to the shared item set concept defined in the iWidget specification.

For portlets that do not provide custom iWidget markup this mapping is automatically performed by the portlet wrapper and transparent for the used portlets. Public render parameters are stored in a shared item set called public-render-parameters. iWidgets can access or modify the parameters by accessing this special shared item set. Similarly to the portlet model, iWidgets can access a parameter value by providing the complete qname for the parameter or a local parameter name that is mapped to a full parameter qname in the widget definition xml file.

<iw:itemSet id="public-render-parameters" private="false">
    <iw:item id="<localWidgetName>" globalid="<qname defined in portlet.xml>"  />
</iw:itemSet>
If the value of a public render parameter is a single String object, the value in the shared item set is of the javascript type string. If the value of a public render parameter is a String array, then the value in the shared item set is a json array containing the different values. Example: A portlet defines the following public render parameter as follows:
<public-render-parameter>
<identifier>foo_portlet</identifier>
<qname xmlns:x=”http://example.com/params”>x:foo</qname>
</public-render-parameter>
The portlet can set a parameter as follows by a call to the ActionResponse interface:
String[] multiValues = { "value1","value2","value3" }        setRenderParameter("foo_portlet", multiValues);
To share parameters with portlets, iWidgets can do the following:

The widget can also define a local name as shown in the following widget definition:

<iw:itemSet id="public-render-parameters" private="false">
    <iw:item id="foo_widget" alias="{http://example.com/params}foo"  />
</iw:itemSet>
In this case it can also access the parameter as follows: itemSet.getItemValue("foo_widget");

  1. Settings for the scope of the public render parameters are also applied to parameters set by iWidgets.

  2. iWidgets can also use custom shareable item sets using a different item set identifier ID than public-render-parameters . However, these custom shareable item sets have the following limitations:

    1. Custom shareable items are not mapped to public render parameters. Therefore they are not available for portlets.

    2. Custom shareable items are not persisted in the navigational state that is kept in the URL. Therefore users cannot bookmark them.


Parent: Options of interactions between widgets and portlets