Set dynamic DDC filter values
IBM Digital Data Connector defines a dedicated public render parameter that can be used by DDC plug-ins for filtering lists.
We can set the value of the DDC filter public render parameter by submitting an HTML form that addresses the URI ddc:filter using an HTTP get method. We can create the HTML form using WCM design components. The following HTML fragment shows a simple search form:
<form action="." method="get"> <input type="hidden" name="uri" value="ddc:filter" /> <input type="hidden" name="prefix" value="<your DDC filter prefix>" /> <input type="hidden" name="action" value="set" /> <input name="value" type="text" value="Enter keywords" /> <input type="submit" value="Submit" name="submitButton" /> </form>When we define such HTML form, take care of the following aspects:
- Set the form action attribute to a period ( . ) and the form method attribute to get.
- Add a form parameter with the name uri and set it to the value ddc:filter.
- Add a form with the name filter and specify the filter value prefix that is recognized by the target DDC plug-in. Using such a prefix enables individual DDC plug-ins to track their filter parameters if multiple plug-ins are active on the same portal page. To determine the appropriate prefix value, read the documentation of the DDC plug-in that we use.
- Add a form parameter with the name action and specify the action to be completed. To set the value, specify set. To remove the value, specify remove.
- Add a form parameter with the name value to specify the filter value to be set. With the remove action, this parameter is ignored.
After the user submits this form, the DDC filter public render parameter is updated in the user's rendering state, and the portal now renders the page in its new state. The parameter value set is concatenated from the values of the prefix parameter and of the value parameter. We can access the full concatenated value in the WCM design components using the RenderParam plug-in. To access the value for a specific prefix, use the ListRenderingContext plug-in with the action attribute set to getFilter.
DDC plug-ins can evaluate the active filter parameter value using the com.ibm.portal.wcm.plr.ListRenderState interface defined by the public Digital Data Connector API.
Parent Implement user interactions