aspose file tools
The moose likes JSF and the fly likes No Validation Message is displayed !! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "No Validation Message is displayed !!" Watch "No Validation Message is displayed !!" New topic
Author

No Validation Message is displayed !!

David Salaete
Greenhorn

Joined: Aug 27, 2008
Posts: 19
Hi all,

I�m having this problem:

I have a rich:datatable:

<rich:column>
<h:inputText id="idE1" value="#{...}">
<f:validator validatorId="positivoValidator"/>
</h:inputText>
<h:message for="idE1" styleClass="aviso"/>
</rich:column>

positivoValidator validates that is a number and is more than 0 and some
other irrelevant things.

When I push a button, I validate in the Managed Bean that the value is less than certain value. (Because that value is variable, I cannot do this validation in the "positivoValidator"):

MessageFactory mf = new MessageFactory();
FacesContext ctx = FacesContext.getCurrentInstance();
if( myValue > topValue)
{
ctx.addMessage("idIPMForm:idE1", new FacesMessage(FacesMessage.SEVERITY_ERROR, mf.getMessage("errorExcesoEnergia"), null));
}
...
return;

But... I obtain the message "WARNING: FacesMessage(s) have been enqueued, but may not have been displayed." and the message is not displayed. Moreover, those messages generated via "positivoValidator" are being displayed Ok.

Why are the Managed-Bean generated one failing??

Thanks in advance,

David S.


There are 10 types of people: Those who understand binary code and those who don�t.
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Hey David,

That error
WARNING: FacesMessage(s) have been enqueued, but may not have been displayed
normally logs when you have successfully set the error message, but have no message element in the page to display that message...

cheers
Darryl
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: No Validation Message is displayed !!
 
Similar Threads
richfaces validation exception
h:message not working
difference between h:messages & h:message
validator not invoke
Error while displaying validation message for inputText generated dynamically in rich:dataTable