-
1. Re: manual validation in Seam
norman.richards Jan 12, 2007 11:12 AM (in response to liudan2005)Using Seam's FacesMessages:
facesMessages.add("country", "your error message");
Note that the id here is not the full clientId that you would normally use when creating a FacesMessage by hand. -
2. Re: manual validation in Seam
liudan2005 Jan 12, 2007 2:04 PM (in response to liudan2005)I've tried this but it doesn't seem to work. I get nothing appeared when user typed wrong thing and left the inputtext box. Here is my code:
public void checkLocation(){ facesMessages.add("country", "error message"); }
my page:<s:decorate> <h:inputText value="#{location.country}" id="country"> <a:support event="onblur" reRender="countryError" action="#{mybean.checkLocation}"/> </h:inputText> <a:outputPanel id="countryError><s:message/></a:outputPanel> </s:decorate>
-
3. Re: manual validation in Seam
norman.richards Jan 12, 2007 9:02 PM (in response to liudan2005)It must be something about the a: components. I'm not familiar with them. If you take out those components you'll see the messages are correctly added. (I just tried it to verify)
-
4. Re: manual validation in Seam
liudan2005 Jan 13, 2007 12:23 PM (in response to liudan2005)The jsf code I've posted was copied from Seam doc: http://docs.jboss.com/seam/1.1GA/reference/en/html_single/#validation
I don't understand why it doesn't work. Removing a:components would lose ajax support. Is this a bug? -
5. Re: manual validation in Seam
pdpantages Jan 13, 2007 2:47 PM (in response to liudan2005)Hello liudan2005
Is the closing quote missing from the id in the a4j:outputPanel ? -
6. Re: manual validation in Seam
norman.richards Jan 14, 2007 1:24 AM (in response to liudan2005)I have no idea if it is a bug. I'm not familiar with those components. I'm only telling you how to make facesMessages show up. You should first verify that it works for you. Then you can add back in the foreign components and figure out what is wrong. Maybe it is a bug. Maybe you don't have those components configured correctly. Maybe the phase of the moon is wrong. :)
-
7. Re: manual validation in Seam
liudan2005 Jan 18, 2007 8:12 AM (in response to liudan2005)I've removed ajax4jsf , it then works. I thinks it's a bug when integrate with ajax4jsf. I've created a JIRA issue: http://jira.jboss.org/jira/browse/JBSEAM-667