Receiving the result of an HTML form submission
The interaction requests the Web Content Viewer portlet mediates result in response information. To access that result information, use the IBM WCM rendering plug-ins.
When we post data to the Web Content Viewer portlet as described under Send data to the Web Content Viewer portlet, the addressed data sink serves the result back in the form of a data source. The Web Content Viewer portlet performs the following operations on that data source:
The URL generated for the action parameter of the HTTP form controls whether the resulting string is stored in a session attribute or set as a private render parameter. We can specify the behavior by setting the corresponding resultSessionAttribute and resultRenderParameter parameters in the action URL plug-in tag that we use to generate the form action URL.
- The portlet transforms that data source into a String value by converting the source into a character source.
- The portlet sets the resulting String value as a corresponding session attribute or private render parameter.
Results
We can then access the session attribute and the render parameter in the web content using the session attribute rendering plug-in and the render parameter rendering plug-in, respectively. For example, if the data source of a data sink returns JSON data, we can process the data further using JavaScript contained in the web content.
Parent Send data to the Web Content Viewer portletRelated reference:
The action URL plug-in
The session attribute plug-in
The render parameter plug-in