how to get values from a Portlet Include

Greetings to all gurus of wM.

I need some of your wisdom.

I have a portlet (called “masterJEDI”) that invoke 2 portlets (called “padawanJR” and “padawanSR”) each one with the control “portlet include”, like this:

masterJEDI

  • portlet include “padawanJR”
  • portlet include “padawanSR”

I know how to the JEDI can send data to the padawans, but i need to know how to the JEDI can get data from the padawans.

In tecnical words, i need to get all the document data (estructure of all data of one “portlet include”) from the parent portlet.

I’m a little newbie… well ok im a little “so much” newbie, can you explain me step by step what to do for solve this?

I need the force!

thx.

I’ve asked this question before and would love to be able to give you a happy answer, but the best I’ve got is that basically you can’t.

Portlets as they stand in MWS are very, very limited. MWS portlets are JSR168 compatible, but it’s only in the JSR286 standard that superceded JSR168 that more inter-portlet communication, events etc are possible. JSR286 was started in 2005 and finalised in 2008, but it’s still not in webMethods.

Some options are:

  • Use commonly-named Javascript methods to pass data around on the page. So if you know two portlets will be on the same page, give one a method method1(data) and call method1 from the other portlet with the data you want to send across. This obviously comes with many problems, but is at least quick to develop and perform.
  • Use the MWS backend to move stuff around. So if your portlets are in the same project, you can probably get and set some stuff to a bean without too much hassle.
  • Use the database backend. This is pretty hideous for some cases, e.g. if you just want to portlet include a standard address lookup and you have to push stuff to the db just to get it from one portlet to another, but I’m including it just in case.
  • Some sort of OpenAJAX solution?

Having said all this - PLEASE will someone tell me I’m wrong and that it’s easy to pass data structures between portlets. I want to be wrong here!

@jorge are these three portlet types contained in the same CAF application project? If they are in the same project then there are some options for sharing managed beans between the portlets.

If the portlet types are not all in one CAF application project, then they are subject to the portlet sandbox limitations that Rob has described. In this is the case, then your options would be to use portlet wiring to push portlet preference values from one portlet to another, or use the proprietary MWS session storage api (See [1]) to stash objects as context attributes that the other portlet can then read.

  1. http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite8-2_sp2/My_webMethods/8-2-SP1_CAF_and_MWS_Java_API_Reference/com/webmethods/portal/bizPolicy/IContext.html

Also, I would encourage everyone who is interested in JSR286 portlet support to make their interest known by adding a feature request @ http://brainstorm.softwareag.com

Hi all,

I find a solution, by mistake,

first i have my process with 2 task, 1 common portlet (for use it as a portlet include).
When i use the same document type in the inputTask and in the portlet bean the data pass clear from protlet JEDI (=P) to the portlet PADAWAN (=P) and vice versa (i don’t know why, but it works), this make much easier the develop, I attached the code and some screenshots.

If you have some example for use it i’ll appreciate it.

thx

example.zip (458 KB)

1 Like

Yes, all your portlets are inside the same CAF application so the managed beans are shared by all the portlets.

Thank you very much jorge omar.
That’s a great solution! :slight_smile:

@Gorge - that was my second suggested solution, but glad you found it!