This discussion is archived
2 Replies Latest reply: Apr 26, 2012 9:59 AM by user501417 RSS

Not highlighting error fields in subform when displaying FacesMessages

user501417 Newbie
Currently Being Moderated
Hi,

I am trying to display FacesMessage on UI and highlight the errored field. It is working as expected if my fields are NOT in subform like this:

<af:form>
<af:inputText label="Label 159" id="it5"/>
<af:commandButton text="commandButton 2" id="cb3"
action="#{viewScope.backing_testFormLayout.validateRecordset}"/>
</af:form>

java codes:

public String validateRecordset() {
FacesContext fc = FacesContext.getCurrentInstance();
fc.addMessage("it5", new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Parameter Name is required",
null));

return null;
}

However, if my fields are in subform, the FaceMessage error is displayed, but the errored field ("it5") is not highlighted.

<af:form>
<af:subform id="s9">
<af:inputText label="Label 159" id="it5"/>
<af:commandButton text="commandButton 2" id="cb3"
action="#{viewScope.backing_testFormLayout.validateRecordset}"/>
</af:subform>
</af:form>


Any ideas?

Thanks
-Mina

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points