I have the following problem, I need to
1)make an ajax call to the server from javascript,
2)pass some dynamic javascript parameters and
3)execute an action method,
Using remoteCommand, the only option I found is:
Code: Select all
<p:remoteCommand name="remoteCommandName" id="remoteCommandID" action="someAction" />
Code: Select all
PrimeFaces.ajax.AjaxRequest(url, {source:'remoteCommandID',...}, {'paramname1':javascript_value_param,...});
Using f:param does not result in what I need, since the parameter is computed statically.
Is weird or against the design to ask for something like:
Code: Select all
<p:remoteCommand name="remoteCommandName" id="remoteCommandID" action="someAction" >
<p:param name="someName" type="client" />
</p:remoteCommand>
I know this means changind org.primefaces.renderkit.CoreRenderer.buildAjaxRequest (...) to consider different classes of parameters.<script type="text/javascript">
function remoteCommandName(arg1){
PrimeFaces.ajax.AjaxRequest(url, {source:'remotepepe', ...'},{'someName':arg1});
}
</script>
Thanks in advance, the components are really good and easy to use.