java - Pass parameters from javascript liferay -
using ipc calling portlet
my problem want pass value hidden field.
but if assign jsp scriplets
<%! public string projectid= "300015"; %>` <portlet:param name="projectid" value="<%= projectid%>" />
it working fine.
but need pass value hidden field:
<input type="text" name="hiddenprojectidbox" id="hiddenprojectidbox">
at place <%= projectid%>
problem solved. may others. no need of hidden fields
var portleturl = new liferay.portleturl('action_phase'); portleturl.setwindowstate("maximized"); portleturl.setportletid("apseprojectmgmtportlet_war_apseprojectmgmtportlet") portleturl.setparameter("_spage", "/apse-projectmgmt-portlet/apse-projectmgmt-portlet/projectcostingsheetaction2"); portleturl.setportletmode('view'); portleturl.setparameter("projectid", projectid); portleturl.setparameter("limit", 10); portleturl.setparameter("offset", 0); document.getelementbyid('myform').action =portleturl.tostring(); document.getelementbyid('myform').submit();
if using ipc using liferay javascript api below code you,
calling portlet javascript,
liferay.fire('update_project', { projectid : a.one('<portlet:namespace />hiddenprojectidbox'), });
receiving portlet javascript
liferay.on('update_project', function(data) { // when event being executed, getstate of selected countrycode via ajax call using resourceurl //data.projectid give value of project id passed calling portlet } );
Comments
Post a Comment