IceFaces message not showing

261 views Asked by At

I´m using IceFaces 1.8.2 and have a problem in my XHTML file:

<ice:messages showSummary="true" showDetail="false" globalOnly="true" />

The code In the action controller:

FacesContext context = FacesContext.getCurrentInstance();
        FacesMessage message = new FacesMessage();
        message.setSeverity(FacesMessage.SEVERITY_ERROR);
        message.setSummary("Error...");
        message.setDetail("Error...");
        context.addMessage("",message);
    ...
    return SEARCH_FORM;

I´ve also tried context.addMessage(null, message) but It does not worked. What would be the right way of using the ice:messages component?

1

There are 1 answers

0
riteshg On

Solved, I will answer my own question, so maybe it helps others with the same problem...

context.addMessage(null, message);
return null; // instead of return SEARCH_FORM

Hope it´s helpful!