Hi,
I'm trying to set up a
jsf page where the user is prompted for an ID and, when the user presses the the button, it shows a new page with user details if ID exist, or a message on the same request page saying "User does not exist".
The relevant page is (replaced brackets with []):
[f:view]
[h:form id="printUser"]
[h:inputText id="myUserID"
value="#{userAvail.userID}" required="true"]
[f:validateLength
minimum="1"][/f:validateLength][/h:inputText]
[h:message showDetail="true" showSummary="true" rendered="true" for="myUserID"][/h:message]
[h:commandButton value="#{bundle.show_user_label}" action="#{userAvail.findUser}" type="submit" title="#{bundle.login_button_label}"][/h:commandButton]
The userAvail.findUser for message generation function is: <br>
FacesContext facesContext = FacesContext.getCurrentInstance();
FacesMessage facesMessage = new FacesMessage(
"User does not exist!");
facesContext.addMessage("myUserID", facesMessage);
My question is: how can I make "User does not exist!" show on the page? Actually, if I use a h:message ... it does not show, if I use a h:messages it is shown.
Thanks