By looking at the generated HTML markup it seems link JSF doing the right thing. As the commandLinkRenderer creates a hidden field for its "params" and also uses a full submit onclick.
For example:
If a menuItem is using a param called "myParam", it would generate the following HTML markup.
<form>
//menuItem with param
<a onclick="var form=formOf(this);form['iceform:j_idcl'].value='iceform:menuBar:file:recent:file2:para2:link';
form['myParam'].value='Para 2';
return iceSubmit(form,this,event);">
//menuItem without any param
<a onclick="var form=formOf(this);form['iceform:j_idcl'].value='iceform:menuBar:edit:copy:link';
return iceSubmit(form,this,event);
//generated by commandLinkRenderer for its param
<input type="hidden" name="myParam" value=""/>
</form>
Use case:
1- Clicked on first menuItem which has a param:
- myParam hidden field being set to "Para 2"
- full submit happens
- bean gets the "Para 2" as "myParam" value.
2- Clicked on a second menuItem without any param:
- myParam is still have old value "Para2"
- full submit happens
- bean gets still gets "Para 2" as "myParam" value.
As we can see that myParam value was never cleared, so seems like everything is right. Wondered why "myParam" being cleared in 1.8.2EE.
I noticed that for some reason the JSF bridge was sending the params that were part of the previous request. So when I tried to debug it, It came across that jsf.js keeps the previous queryString to build the new request in some cases (according to my understanding).
/**
*/
req.sendRequest = function() {
.....
// Some logic to get the real request URL
if (req.generateUniqueUrl && req.method == "GET") { req.parameters["AjaxRequestUniqueId"] = new Date().getTime() + "" + req.requestIndex; }
var content = null; // For POST requests, to hold query string
)
for (var i in req.parameters) {
if (req.parameters.hasOwnProperty
}