13.3 Broadcasting source data

 < Day Day Up > 

Using the broadcast feature of the cooperative broker, users can send the same data to all portlets on the page with matching actions. The target cooperative portlet of a broadcast can use the declarative or programmatic approach to publish properties.

To include the broadcast menu item to the HRPortlet , proceed as follows :

  1. Open the JSP HRPortlet/Web Content/hrportlet/jsp/html/HRPortletView.jsp.

  2. In the encodeProperty tag, include the broadcast attribute so it looks as shown in Example 13-1.

    Example 13-1. The broadcast attribute enables the broadcast feature.
     <P>    <C2A:encodeProperty    name="<%=results.getColumnName(col).toString()+\"Param\"%>"    namespace="http://www.ibm.com/wps/c2a/examples/hrdetails"    type="<%=results.getColumnName(col)%>"    value="<%=results.getCacheValueAt(row, col).toString()%>"  broadcast="true"/>  <%=results.getCacheValueAt(row, col)%> </P> 
  3. Test the application as described in the last chapter. Do not forget to enter the database attribute in the Edit mode of both the Employee and Department Details Portlets.

  4. From the cooperative portlet menu choose Invoke all actions . Now both details portlets display the details of the selected department number.

Figure 13-2. Choose Invoke all actions to broadcast the data to all portlets

graphics/13fig02.gif

 < Day Day Up > 


IBM WebSphere Portal V5 A Guide for Portlet Application Development
IBM Websphere Portal V5: A Guide for Portlet Application Development
ISBN: 0738498513
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net