Hi kwintesencja,
A few days back I was looking out for a similar solution. Though I could find out a way to pass parameters into remoteCommand but I figured out a way, (from BalusC's blog) that you could use a hidden input field submit that was set by javascript and hence pass your parameter from js to JSF. My code for this follows:-
I would really appreciate if someone can look at this and kindly let us know, if this is the best way to pass parameters from js to JSF.
<script>
function prepareForShowingDetails(idOfSelected) {
document.getElementById('selectedItemId_in').value = idOfSelected; //setting the hidden input field with the parameter required to be passed .....
showDetails(); // calling remoteCommand to show the content details
}
</script>
<h:form prependId="false" >
<h:inputHidden id="selectedItemId_in" value="#{list.selected}"/>
<p:remoteCommand name="showDetails" process="selectedItemId_in" update="detailsPanel" oncomplete="detailsDialog.show()"/>
</h:form>