0

Our project in WebSphere Portal 8.5 have a few portlets (JSR 286).

Portlet A for example contains pages with description of some goods, and tools for the editing this description. And Portlet B contains tools for create orders for these goods (this is a very simplified, but it should be enough to understand the problem).

We need to create link from one portlet to another with the passing some parameters both in one direction and vice versa. How we can do this? It would be very useful to see simple code examples for a better understanding

Thank you

1 Answers1

0

Well your most basic approach is to use public render parameters https://www.ibm.com/support/knowledgecenter/en/SSYJ99_8.5.0/dev-portlet/pltcom_pubrndrprm.html

Set it up in the portlet.xml

    <portlet>
      ...
      <supported-public-render-parameter>custID</supported-public-render-parameter>
   </portlet>
   <public-render-parameter>
      <identifier>custID</identifier>
      <qname>x:customerID</qname>
   </public-render-parameter>

and then you can get it liket his String customerID = renderRequest.getParameter("custID");

If you need something more complex, you could put items into application scope in the session and share them that way and when the page renders again both have access to it

or you could use the url generation apis but that would be the last thing I would recommend

Crosstalk22
  • 377
  • 3
  • 8
  • is correct that the most basic approach is public render parameters, but for more complex scenarios you should use the JSR 286 provided mechanism of portlet events: - https://www.ibm.com/support/knowledgecenter/en/SSYJ99_8.5.0/dev-portlet/pltcom_events.html - http://www.oracle.com/technetwork/java/jsr286-141866.html#Coordination_Between_Portlets – Carlos Sep 07 '17 at 17:56
  • @carlos I knew I forgot one – Crosstalk22 Sep 11 '17 at 14:55