Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Re: [Liferay Forums][3. Development] Pass parameters to a portlet confi
Hi all.
portal Until Liferay version 4.4.2 I was able to pass parameter to a portlet configured in a page using the instance name.
For instance if I wanted to pass the articleId 10130 to the JournalContent portlet I needed just to add in the URL _56_INSTANCE_tes1_articleId=10130, considering that in this particular case the instance name was 56_INSTANCE_tes1.
I am trying to update to liferay portal 5.1.0 but I am not able to use this approach any more.
Can you help me?
Best regards.
portal Until Liferay version 4.4.2 I was able to pass parameter to a portlet configured in a page using the instance name.
For instance if I wanted to pass the articleId 10130 to the JournalContent portlet I needed just to add in the URL _56_INSTANCE_tes1_articleId=10130, considering that in this particular case the instance name was 56_INSTANCE_tes1.
I am trying to update to liferay portal 5.1.0 but I am not able to use this approach any more.
Can you help me?
Best regards.
On Tue, 2008-09-09 at 13:22 +0000, Mario Striglione at Liferay's
Community Forums wrote:
> I am trying to update to liferay portal 5.1.0 but I am not able to use
> this approach any more.
It's because according to the JSR-286 spec, it is illegal to pass a
parameter to a portlet when you are not directly targeting the portlet,
which means you have to include the p_p_lifecycle and p_p_id params
along with the namespaced param.
This ends up looking like:
[tt]p_p_lifecycle=0&p_p_id=56_INSTANCE_tes1&_56_INSTANCE_tes1_articleId=10130[/tt]
which is kinda ugly and heavy.
SO, use the friendly URL instead:
[tt]<layoutFriendlyURL>/-/journal_content/<groupId>/56_INSTANCE_tes1/10130[/tt]
Community Forums wrote:
> I am trying to update to liferay portal 5.1.0 but I am not able to use
> this approach any more.
It's because according to the JSR-286 spec, it is illegal to pass a
parameter to a portlet when you are not directly targeting the portlet,
which means you have to include the p_p_lifecycle and p_p_id params
along with the namespaced param.
This ends up looking like:
[tt]p_p_lifecycle=0&p_p_id=56_INSTANCE_tes1&_56_INSTANCE_tes1_articleId=10130[/tt]
which is kinda ugly and heavy.
SO, use the friendly URL instead:
[tt]<layoutFriendlyURL>/-/journal_content/<groupId>/56_INSTANCE_tes1/10130[/tt]
Hi!
Thanks for the answer.
But what if I need to pass parameters to two different instances of two different portlets? In this way I can refer only to one instance of one portlet.
Best regards.
Thanks for the answer.
But what if I need to pass parameters to two different instances of two different portlets? In this way I can refer only to one instance of one portlet.
Best regards.
Hi.
I'm developing a portal in Liferay for our company.
And we need to render one page with few portlets, but all of these portlets need to get the same parameter at a time.
Getting a parameter from page request seams to be best solution for this.
Is it possible? Or is there another way to do this?
Best regards.
I'm developing a portal in Liferay for our company.
And we need to render one page with few portlets, but all of these portlets need to get the same parameter at a time.
Getting a parameter from page request seams to be best solution for this.
Is it possible? Or is there another way to do this?
Best regards.
I figured it out, by using JSR-286 public render parameter in portlet.xml
(example for jsf: http://blogs.sun.com/deepakg/entry/jsf_portlet_and_public_render)
Maybe someone will find it useful.
(example for jsf: http://blogs.sun.com/deepakg/entry/jsf_portlet_and_public_render)
Maybe someone will find it useful.