Hello
I can't find any resources which can answer why I'm getting an error with this:
oncomplete="#{MyBacking.oError ? #{rich:component('oErrorPanel')}.show() : return false;}"
in a richfaces a4j:commandButton
. oError is referring to a method in my bean called isOError.
I'm getting the error
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
org.apache.el.parser.ParseException: Encountered " "?" "? "" at line 1, column 30.
Was expecting one of:
"}" ...
"." ...
...
I want to say 'if a method returns true, show modal panel A otherwise false'. Any help much appreciated.
EDIT I've edited the code so it looks as follows:
<a4j:region id="Cont">
<a4j:form name="Form">
<h:panelGrid columns="2" style="padding: 2px;">
<h:outputText value="Old password " />
<h:inputSecret id="FormOldP" value="#{MyBacking.dbOldPwd}" />
<h:outputText value="New password " />
<h:inputSecret id="FormNewP0" value="#{MyBacking.dbNewPwd0}" />
<h:outputText value="Re-enter new password " />
<h:inputSecret id="FormNewP1" value="#{MyBacking.dbNewPwd1}" />
<h:panelGroup>
<a4j:commandButton value="Submit"
action="#{MyBacking.dbPwdChange}"
data="#{MyBacking.oldDbPwdError}"
oncomplete="if(data == true) { rich:component('OldErrorPanel').show(); }"
image="/img/btnSubmit16.png"
reRender="sysMsg,FormCont" />
<a4j:commandButton value="Cancel"
onclick="#{rich:component('MyPanel')}.hide();return false;" />
</h:panelGroup>
</h:panelGrid>
</a4j:form>
</a4j:region>
This compiles fine, but even if the boolean is set to true (when old passwd is not as the one stored) panel MyPanel remains on screen but the error modal OldErrorPanel doesn't appear. The above looks ok to me though. This is the java:
public void setOldDbPwdError(boolean b) {
logger.info("setting ldDbPwdErro to "+b);
oldDbPwdError = b;
}
public boolean isOldDbPwdError() {
logger.info("asking for isOldDbPwdError, returning" +oldDbPwdError);
return oldDbPwdError;
}
Any further advice greatly appreciated.