2 Replies Latest reply on May 13, 2008 9:36 AM by Borbas Sandor

    Multiple portlet instances on same page

    Borbas Sandor Newbie

      I have one problem - i hope for it, it problem only for me.

      I developed two portlets, with JSF RI - and running with 2.6.1 GA Portal. The first portlet displaying an document, the second is diplaying an list. The two portlets are can communicate with each other by shared objects in PortletSession.APPLICATION_SCOPE. The communication works well.

      But.. I deployed three portlet instances, one is a 'displayer' portlet, and the other are instances of 'lister' portlet on same portal page. The lister instances are displaying different lists - the list generation based on an portlet instance parameter. When I selected an item in the first lister instance, everything working well - the diplayer portley loads a document, what i want. But if I clicked on a link in the second lister instance, wrong JSF actionlistener called : it looks like, as if i clicked in the first instance. If I clicking third link of the second list, happens like, if I clicking in the first instance on the third link. With further words : when I clicking in the second instance, then the Portal is calling the actionlistener of the fist instance.

      How can I fix this problem?

      JSF code :
      <f:view>
      <h:form>
      <h:dataTable value="#{taggedListBean.items}" var="thisItem" >
      <h:column>
      <h:commandLink action="#{taggedListBean.click}" actionListener="#{taggedListBean.viewItemAction}" >
      <f:param id="ItemId" name="ItemId" value="#{thisItem.itemId}" />
      <h:outputText value="#{thisItem.title}" />
      </h:commandLink>
      </h:column>
      </h:dataTable>
      </h:form>
      </f:view>

      Actionlistener :
      public void viewItemAction(ActionEvent event)
      {
      UIParameter component = (UIParameter) event.getComponent().findComponent("ItemId");
      int ItemId = Integer.parseInt(component.getValue().toString());
      .
      .
      .