I am trying to do wiring between a portlet and a portlet include in this first portlet (using portlet include control).
Once I click ok, the server seems to perfom an infinite loop and crash (Stack ooverflow)
2007-04-19 15:11:45 EDT (Framework : WARN) [RID:3] - [POP.003.0160] Failed to resolve wiring for property “invokeFromTab”
java.lang.StackOverflowError
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
My question is, can Ido wiring between a portlet and a included portlet?
Thanks
Bert
I’m not sure I completely understand the structure of your page.
Is it: ‘Portlet A’ uses the Portlet Include control to render ‘Portlet B’. And then ‘Portlet B’ is attempting to use portlet wiring to get a value out of ‘Portlet A’?
Exactly…
This give me a Stackoverflow.
But when I try to use Wiring between Portlet B and another one (Portlet C) everything works.
Thanks
Bert
To add to my last message,
When I remove from Portlet A the include portlet B, the wiring works OK.
As soon I enable the portelt include, system goes to a non-stopping loop. Then Stack overflow.
Bert
Unfortunately, wiring will not work for that particular scenario. This is because during the resolution of the wiring, the wiring source portlet is rendered. This is done to handle the case where the wiring source is changed during the rendering of the source portlet. In your scenario, that causes a loop.
Here are a couple of alternatives:
-
Disconnect the wiring and instead pass the property value to inner portlet with a portlet parameter instead.
For example:
In MwS 6.5.x JSP page use something like this:
<portlet:portlet uri=‘portletA_alias’>
<util:param name=‘aProp1’ value=‘<%=portletB.getBProp1()%>’></util:param>
</portlet:portlet>
Or for a MwS 7.x view, use ‘Control Parameter’ (from the logic category) as a child of the ‘Portlet Include’ control to pass a name/value to the included portlet. The ‘Control Parameter’ name property would be the name of the portlet preference you wish to override and you can use a binding expression for the ‘Control Parameter’ value to lookup the source value from ‘Portlet A’.
-
Create an intermediary portlet that holds the wired data and have both of the other portlets wired to it instead.
For example:
Portlet C is the wiring source (exposes prop1 for wiring)
Portlet A and Portlet B are on the page
Portlet A aProp1 wired to Portlet C prop1
Porlet B bProp1 also wired to Portlet C prop1
Ok thanks for the info.
I will try to implement approach 1b ( MwS 7.x)
But how do I retreive in my Portlet B the ‘Control Parameter’ ?
The ‘Control Parameter’ behaves very similar to wiring. The ‘value’ of the control parameter replaces the preference value (whose name == parameter name) of the target portlet.
If you are rendering a ‘Portlet Include’ for ‘Portlet B’ that has a ‘Control Parameter’ with the following properties:
Name: bProp1
Value: #{activePageBean.portletA.aProp1}
then the value of the bProp1 property of ‘Portlet B’ would be assigned the value of the resolved value expression (in this case expression resolves to the value of the aProp1 property of ‘Portlet A’).
Hi,
I’m trying to use the “portlet inlcude” as indicated in that Post to send data from a portlet to another one but it doesn’t work.
I have two portlets: portlet A and portlet B. Portlet B is an include in portlet A(by using the control “Portlet Include”).
I use a “Control parameter” in the “Portlet include” of portlet A with the following properties:
Name: Parameter1
Value: i set some value from a document
In portlet B, i create a Property under Preferences map with the same name that i used for the Control parameter(Parameter1)
Name: Parameter1