Todd Patrick wrote:
> JSF 1.2
> Sun Java System Application Server Platform Edition 9.0_01 (build b14)
>
> I have the following in my .jsp file:
>
> <h:messages id="searchResultsMsg" styleClass="alert"/>
>
>
> In my Class file, I have:
>
> FacesContext facesContext = FacesContext.getCurrentInstance();
> FacesMessage message = new FacesMessage();
>
> message.setSeverity(FacesMessage.SEVERITY_ERROR);
> message.setSummary("No customers containing all your search terms were
> found.");
> message.setDetail("Suggestions:\n" +
> "Make sure all words are spelled correctly.\n" +
> "Try different keywords.\n" +
> "Try more general keywords.\n" +
> "Try fewer keywords.");
> facesContext.addMessage("customerForm:searchResultsMsg", message);
> facesContext.renderResponse();
>
>
> While debugging, I check the facesContext object after the line:
>
> facesContext.renderResponse();
>
>
> There is a single componentMessageLists Map entry, so there is a valid
> message object in the facesContext. However, the h:messages is never
> render after the lifecycle has completed.
>
> Is there a 1.2 way of displaying FacesMessage from a Class file?
>
Just off the cuff, try adding the message without the client ID, or use
the Client ID of the
input field and not of the message component.
> Thanks,
>
> --Todd
>
> -----------------------------------------
> NOTICE: This email message is for the sole use of the intended
> recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized
> use, disclosure or distribution is prohibited. If you are not the
> intended
> recipient, please contact the sender by reply email and destroy all
> copies
> of the original message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>
>