-
1. Re: TypeError: f is null from jsf.js when I click on h:commandLink in rich:treeNode
michpetrov Sep 22, 2015 5:15 AM (in response to vpenugo)Can you disable optimization and paste the part of JavaScript where the error occurs?
-
2. Re: TypeError: f is null from jsf.js when I click on h:commandLink in rich:treeNode
vpenugo Sep 22, 2015 7:10 AM (in response to michpetrov)Thank you Michal for your response. I disabled the optimization. but still i am getting JavaScript error. below is the code and highlighted the line where I am getting the issue from both(IE8 & FireFox) browsers.
In IE8 I am getting 'Unexpected call to method or property access.'
IE8:
mojarra.apf = function apf(f, pvp) {
var adp = new Array();
f.adp = adp;
var i = 0;
for (var k in pvp) {
if (pvp.hasOwnProperty(k)) {
var p = document.createElement("input");
p.type = "hidden";
p.name = k;
p.value = pvp[k];
f.appendChild(p); // Error Line //
adp[i++] = p;
}
}
};
FireFox ( I am getting - 'TypeError: f is null' error)
mojarra.apf = function apf(f, pvp) {
var adp = new Array();
f.adp = adp; // Error Line //
var i = 0;
for (var k in pvp) {
if (pvp.hasOwnProperty(k)) {
var p = document.createElement("input");
p.type = "hidden";
p.name = k;
p.value = pvp[k];
f.appendChild(p);
adp[i++] = p;
}
}
};
Note: If I disabled the optimization , style classes are not loading and I am getting 'NoClassDefFoundError: org/w3c/css/sac/InputSource' exception.
-
3. Re: TypeError: f is null from jsf.js when I click on h:commandLink in rich:treeNode
michpetrov Sep 22, 2015 9:44 AM (in response to vpenugo)Turning the optimization off was for not having the JavaScript minimized. The f variable is supposed to be the parent form. If you look at the code generated for the link it should be something like <a href="#" onclick="mojarra.jsfcljs(document.getElementById('form'),{'form:j_idt4':'form:j_idt4'},'');return false">link</a> Is your code inside a form? Also are you using h:head? It would explain the missing styles.
-
4. Re: TypeError: f is null from jsf.js when I click on h:commandLink in rich:treeNode
vpenugo Sep 30, 2015 8:45 AM (in response to michpetrov)Thank you Michal for your response. There is form inside form.. So, I removed the inner form and command link is working fine. and for style exceptions, actually I forget to include sac-1.3 jar. after include this jar, styles are working fine now.