Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

No Validation Message is displayed !!  RSS feed

 
David Carrascal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Darryl Nortje
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!