I have a js file(abc.js) and having a function increment().Which stores count of places as var noOfPlaces.
In the xhtml file.Have a component which is having onclick function.
I want to have if else condition inside onclick based on noOfPlaces.
abc.js
function increment(){
var noOfPlaces=(some methods);
cde.xhtml
<a4j:commandLink id="Import" type="submit"
rendered="#{()}"
onclick="focusOn('Import');if else condition
How can we use jaavascrpt variable value in xhtml page and write if else condition in onlick> I know how to use javamethods in xhtml (classname.methodname).How can we do for js file Thanks in advance
<a href="#" onclick="...">instead of<a4j:commandLink onclick="..">. If you still face exactly the same JavaScript problem there in the plain vanilla HTML page, then it's definitely not JSF related and you need to rewrite your question. Note that even when it's actually JSF related, your problem would still have got nothing to do with "XHTML".