Foros de discusión

How to pass form parameters to liferay popup?

Mohamed Salah Guetat, modificado hace 12 años.

How to pass form parameters to liferay popup?

New Member Mensajes: 2 Fecha de incorporación: 3/08/11 Mensajes recientes
hi,

My question is how do i can pass form parameters to liferay popup?

here is my code

<aui:form name="fm" action="<%=action1.toString() %>" method="post">
    <aui:input name="MyString" />
    <aui:button type="submit" />
</aui:form>


<portlet:renderurl var="action2" windowstate="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
	  <portlet:param name="jspPage" value="/html/virtualmeetings/list_of_users.jsp" />
</portlet:renderurl>


<script type="text/javascript" charset="utf-8">
	function showPopup() {
		  AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
		   
		    var dialog = new A.Dialog({
		            title: 'Popup Title',
		            centered: true,
		            draggable: true,
		            modal: true,
		            scrollbars :true
		        }).plug(A.Plugin.IO, {uri: '<%= action2%>' }).render();    
		        dialog.show();	       
		  });
		}
 </script> 


So i need to pass "MyString" parameter from the current JSP to the popup window !

Is there a way to do this?

Regards
Mohamed Salah GUETAT
thumbnail
Mayur Patel, modificado hace 12 años.

RE: How to pass form parameters to liferay popup?

Expert Mensajes: 358 Fecha de incorporación: 17/11/10 Mensajes recientes
Hi Mohamed,

you can pass parameter "MyString" while generating renderURL so, when you call popup for rendering it will go to that jsp page with that parameter "MyString"

In list_of_users.jsp you can fetch value of "MyString" and perform oprations.

<portlet:renderurl var="action2" windowstate="<%= LiferayWindowState.EXCLUSIVE.toString() %>">
      <portlet:param name="jspPage" value="/html/virtualmeetings/list_of_users.jsp" />
      <portlet:param name="MyString" value="<%= MyStringValue%>" />
</portlet:renderurl>


In render method you can get that Parameter and set the value so that It will be available to that jsp page

String MyStringValue= renderRequest.getParameter("MyString"); 
renderRequest.setAttribute("MyString",MyStringValue);


HTH, Mayur