Primefaces.addSubmitParam issue
Posted: 19 Oct 2011, 04:34
Hi,
I just noticed an issue when I was making multiple ajax requests when using Primefaces.addSubmitParam in my javascript. When multiple ajax requests are done without refreshing the page (i.e not ajax, but a full submit), new submit params with the same key do not work (you get the old one).
I've gotten around this by overriding addSubmitParam in my javascript like so:
This is just a small change from the original:
Don't know if anyone else has run into the same thing, but figured I'd throw it out there in case anybody found it useful. I don't think it's relavent, but just in case, I'm running the latest primefaces snapshot with mojarra-2.1.2 on glassfish 3.1.1, using Google Chrome as a browser.
Cheers,
Bill
I just noticed an issue when I was making multiple ajax requests when using Primefaces.addSubmitParam in my javascript. When multiple ajax requests are done without refreshing the page (i.e not ajax, but a full submit), new submit params with the same key do not work (you get the old one).
I've gotten around this by overriding addSubmitParam in my javascript like so:
Code: Select all
PrimeFaces.addSubmitParam = function(parent, name, value) {
$(this.escapeClientId(parent)).append("<input id=\"" + "submitParam_" + name + "\" + type=\"hidden\" name=\"" + name + "\" value=\"" + value + "\"/>");
var child = $("#submitParam_" + name);
child.val(value);
return this;
};
Code: Select all
addSubmitParam : function(parent, name, value) {
$(this.escapeClientId(parent)).append("<input type=\"hidden\" name=\"" + name + "\" value=\"" + value + "\"/>");
return this;
}
Cheers,
Bill