I have a simple code that does validation upon click of a button (not a submit button). Whatever data save/processing I want to do, I am doing at the server side via SSJS
.
Situation: If I write a simple alert("Hi")
under Client events (onCLick)
, it gives me an alert upon click and proceeds to SSJS
.
But if I try to read any field using document.getElementByID("inputText1").value
, it does not respond to clicks neither executes alert()
which is there after the above line.
Tried to change the way id is passed as #{id:inputText1}
also but nothing works.
FYI: I am doing a partialRefresh()
on that button event and the only way I have to stop processing the unfurnished data is using cancelPartialRefresh()
which is defined below (got this famous code from stack-overflow only).
function cancelPartialRefresh(){
var response = facesContext.getExternalContext().getResponse();
response.setHeader("X-XspRefreshId", "@none");
response.reset();
response.commitResponse();
facesContext.responseComplete();
}
This is not giving any message to user that something is missing but is not letting the refresh from happening though.
Please let me know what I am missing.