I'm not really clear on what your use-case is; but in theory, you could pass the parameter using the <f:attribute/>
tag on any given component.
Add the
<f:attribute/>
tag to the component initiating the AJAX call<p:commandLink id="aComponent" value="#{bean.val}" action="#{bean.doSomething}"> <f:attribute name="conversationId" value="#{param['cid']}"/> </p:commandLink>
You can pull the parameter from the component's parameter map in your backing bean:
FacesContext context = FacesContext.getCurrentInstance(); UIViewRoot theView = context.getViewRoot(); UIComponent component = theView.findComponent("aComponent"); Integer theConversationId =(Integer) component.getAttributes().get("cid");
The key point here is that the parameter is available in the #{param}
map (as any other GET
parameter). The reason why it's not automatically transmitted via ajax is just that: GET parameters require a full HTTP request to be transmitted. The whole point of AJAX is that you can pick and choose what to send to the server.