Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Vaibhav Mittal
Passing data onClick to a different page
17 de Janeiro de 2013 09:03
Resposta

Vaibhav Mittal

Ranking: Junior Member

Mensagens: 54

Data de entrada: 16 de Julho de 2012

Mensagens recentes

I have built a search portlet which shows result in a table. One column of that table contains view hyperlink.

Now what I want is, when someone clicks on that view link, data from the result table gets passed to the new page and display result according to the data I am passing to the new page. Here new page should be same but display different result on clicking of different view links.
If someone can guide me the further steps.

Thnxx & Regards,
Vaibhav Mittal
Siddharth Barsaniya
RE: Passing data onClick to a different page
21 de Janeiro de 2013 03:21
Resposta

Siddharth Barsaniya

Ranking: New Member

Mensagens: 13

Data de entrada: 20 de Fevereiro de 2012

Mensagens recentes

Hi Vaibhav,
I have done this using aui-dialog, passing the data to the calling popup based on the link clicked and the result will display accordingly.

Regards,
sid
Priyanka Dhingra
RE: Passing data onClick to a different page
21 de Janeiro de 2013 05:14
Resposta

Priyanka Dhingra

Ranking: Liferay Master

Mensagens: 501

Data de entrada: 19 de Dezembro de 2011

Mensagens recentes

you can use
1<portlet:renderURL>
Subhash Pavuskar
RE: Passing data onClick to a different page
21 de Janeiro de 2013 06:30
Resposta

Subhash Pavuskar

Ranking: Regular Member

Mensagens: 234

Data de entrada: 12 de Março de 2012

Mensagens recentes

Hi Vaibhav Mittal ,

Adding more points to Priyanka Dingra's post !! try this code on your first page i.e page1.jsp to redirect to page2.jsp

1
2<portlet:renderURL var="clickRenderURL">
3<portlet:param name="jspPage" value="/WEB-INF/view/page2.jsp" />
4</portlet:renderURL>
5
6<a href="<%=clickRenderURL %>">Click here</a>


Hope this may help you !!
Ajeet Singh
RE: Passing data onClick to a different page
21 de Janeiro de 2013 08:58
Resposta

Ajeet Singh

Ranking: New Member

Mensagens: 14

Data de entrada: 27 de Março de 2012

Mensagens recentes

You can achieve that using actionUrl as well as renderUrl. In your requirement, you are supposed to display different data, hence it is required to fetch data from some sorces. Hence you should go through actionUrl. You can get the parameter values like actionRequest.getParameter("employeeId") or rederRequest.getParameter("employeeId") in action phase or render phase respectively.

1<div>
2                <a href="<portlet:actionURL>
3                                <portlet:param name="employeeId" value="<%=employee.getEmployeeId()%>"/>
4                                <portlet:param name="employeeName" value="<%=employee.getEmployeeName()%>"/>
5                                <portlet:param name="employeeAddress" value="<%=employee.getEmployeeAddress%>"/>
6                        </portlet:actionURL>">
7                </a>
8       </div>


1<div>
2                <a href="<portlet:renderURL>
3                                <portlet:param name="employeeId" value="<%=employee.getEmployeeId()%>"/>
4                                <portlet:param name="employeeName" value="<%=employee.getEmployeeName()%>"/>
5                                <portlet:param name="employeeAddress" value="<%=employee.getEmployeeAddress%>"/>
6                        </portlet:renderURL>">
7                </a>
8       </div>


I hope that, you will get through this.

Regards,
Ajeet Singh
Vaibhav Mittal
RE: Passing data onClick to a different page
21 de Janeiro de 2013 08:58
Resposta

Vaibhav Mittal

Ranking: Junior Member

Mensagens: 54

Data de entrada: 16 de Julho de 2012

Mensagens recentes

Thnxx subhash, priyanka and Sid for your replly.
Sid, aui-dialog will open a dialog box on the same page but my requirement is to open the details on a new page.
<portlet:renderURL> will open a new jsp for sure but in the same portlet on the same page. This will just replace the old jsp and calls the new jsp using doview method. The same can be achieved by calling edit mode programatically on click(by changing mode).

I want to open this new jsp on a new page (on click), the way window.open() do opens up a new window. If this can be achieved?
Rajeeva Lochana .B.R
RE: Passing data onClick to a different page
24 de Janeiro de 2013 12:38
Resposta

Rajeeva Lochana .B.R

Ranking: Junior Member

Mensagens: 65

Data de entrada: 4 de Janeiro de 2010

Mensagens recentes

Hi Vaibhav,

Place the attribute target="_NEW" inside the anchor tag to open content in new window.

Check the below example

 1
 2
 3<portlet:renderURL var="JSPURL">
 4.....
 5</portlet:renderURL>
 6
 7or
 8<portlet:actionURL var="JSPURL">
 9.....
10</portlet:actionURL >
11
12
13<a href="javascript:void(0);" onclick="<%= JSPURL.toString() %>" target="_NEW" >View </a>
Gwowen Fu
RE: Passing data onClick to a different page
25 de Janeiro de 2013 14:16
Resposta

Gwowen Fu

Ranking: Expert

Mensagens: 315

Data de entrada: 27 de Dezembro de 2010

Mensagens recentes

Use <liferay-portlet:renderURL> will take you to the page where the portlet is placed.
Zeeshan Khan
RE: Passing data onClick to a different page
28 de Fevereiro de 2013 21:19
Resposta

Zeeshan Khan

Ranking: Expert

Mensagens: 349

Data de entrada: 20 de Julho de 2011

Mensagens recentes

Vaibhav Mittal:
I have built a search portlet which shows result in a table. One column of that table contains view hyperlink.

Now what I want is, when someone clicks on that view link, data from the result table gets passed to the new page and display result according to the data I am passing to the new page. Here new page should be same but display different result on clicking of different view links.
If someone can guide me the further steps.

Thnxx & Regards,
Vaibhav Mittal



Hi Vaibhav...

how u created this search portlet...?? can us share this.....??
I also have to create this search box on top of the banner of liferay.....