留言板

How to pass parameters to another page

Luca kk,修改在12 年前。

How to pass parameters to another page

Expert 帖子: 284 加入日期: 10-12-7 最近的帖子
Hi all,
I have a question.
I have a jsp, of a "Portlet1", with two links: the first sets a variable for action and
the second calls another liferay page, as:

<liferay-portlet:actionurl var="test_url" name="test">
    <liferay-portlet:param name="video" value="sample1" />
    <liferay-portlet:param name="tipo" value="mp4" />
   </liferay-portlet:actionurl>
   <a href="${test_url}">Test Video</a>
   <br>

   <a href="http://my-server:8080/web/guest/testPage?"> Link to Test Page</a>


I have to merge two operations in one link that when i click on it
the page has to change and i have to pass "${test_url}" to a "Portlet 2"
of "testPage".

How can I do?
Thanks in advance,
Luca
thumbnail
Hitesh Methani,修改在12 年前。

RE: How to pass parameters to another page

Regular Member 帖子: 171 加入日期: 10-6-24 最近的帖子
Hi Luca,

You need to pass plid in liferay-portlet:actionURL, that is layout id for the page you want to redirect to.

For more info, you can refer the forum entry http://www.liferay.com/community/forums/-/message_boards/message/9022781

Thanks,
Hitesh Methani.
Luca kk,修改在12 年前。

RE: How to pass parameters to another page

Expert 帖子: 284 加入日期: 10-12-7 最近的帖子
Hi Hitesh,
thanks for reply.
I have read the thread, but how can I get "plid" of "testPage"?
And then, how do I redirect to "testPage" from "doView"
method of the first portlet?
Can you give me more details?
Luca
thumbnail
Hitesh Methani,修改在12 年前。

RE: How to pass parameters to another page

Regular Member 帖子: 171 加入日期: 10-6-24 最近的帖子
Hi Luca,

For getting the plid you need to get the layout as follows :


Layout previewPageLayout = LayoutLocalServiceUtil.getFriendlyURLLayout(groupid for guest,boolen true if private page and false if public page ,Friendly url that is "/testpage" in your case);


previewPageLayout.getPlid() will give you the plid,

now mentioning the plid you will get redirect to testPage itself.

Hope this helps,

Regards,
Hitesh
Luca kk,修改在12 年前。

RE: How to pass parameters to another page

Expert 帖子: 284 加入日期: 10-12-7 最近的帖子
Hi Hitesh,
thanks,
but then how can I pass the "${test_url}" variable
and redirect to testPage by one link:

<a href="http://myserver:8080/web/guest/testPage?"> Link to test Page </a>


Have I do it in Process Action of first portlet?

Best regards,
Luca
thumbnail
Hitesh Methani,修改在12 年前。

RE: How to pass parameters to another page

Regular Member 帖子: 171 加入日期: 10-6-24 最近的帖子
Hi Luca,

Test url in that case will be current url on the page you will be redirected to.
So you can get the test url by simply getting current url from PortalUtil.

Regards,
Hitesh
thumbnail
Mani kandan,修改在12 年前。

RE: How to pass parameters to another page

Expert 帖子: 492 加入日期: 10-9-15 最近的帖子
Best way to achieve to try this InterPortlet
thumbnail
Sagar A Vyas,修改在12 年前。

RE: How to pass parameters to another page

Liferay Master 帖子: 679 加入日期: 09-4-17 最近的帖子
Hi Luca,

Please correct me if I miss-understood your requirement

You want something like

By-clicking on page-A of Portlet A you want redirect on page-B of Portlet B ?


Thanks,
Sagar Vyas