-
1. Re: Manual entity validation with Seam-like feedback
blabno Aug 11, 2008 4:33 PM (in response to wilczarz.wilczarz.gmail.com)facesMessages.addToControl( "invalidControlId", new FacesMessage(FacesMessage.SEVERITY_ERROR,"it is bad","oh so bad") );
Note the
SEVERITY_ERROR
-
2. Re: Manual entity validation with Seam-like feedback
wilczarz.wilczarz.gmail.com Aug 11, 2008 5:20 PM (in response to wilczarz.wilczarz.gmail.com)Still the same - messages render in <h:messages> and the inputs are not hilighted. I'm inside a long-running conversation, does it matter?
-
3. Re: Manual entity validation with Seam-like feedback
wilczarz.wilczarz.gmail.com Aug 12, 2008 10:41 AM (in response to wilczarz.wilczarz.gmail.com)Ok, this code does the job:
import javax.faces.context.FacesContext; FacesContext.getCurrentInstance().addMessage( "invalidControlId", new FacesMessage(FacesMessage.SEVERITY_ERROR,"it is bad","oh so bad"); );
This is weird though, not to be able to use the injected component.
-
4. Re: Manual entity validation with Seam-like feedback
arnieaustin.arnie.morein.me.com Nov 15, 2008 11:28 PM (in response to wilczarz.wilczarz.gmail.com)I read this and tried:
this.facesMessages.addToControl("formEditPatient:nameFirst", new FacesMessage(FacesMessage.SEVERITY_ERROR, msgRequiredField, msg));
Where the client-id is made up the explicit h:form and h:inputText component names.It didn't work. Looking at the page source, I found:
div id="formEditPatient:nameLast"
...
input id="formEditPatient:nameLast:nameLast" type="text" name="formEditPatient:nameLast:nameLast"
...Which is definitely NOT what I expected. I put the nameLast:nameLast in the program code and the field is still not highlighted and the summary isn't showing up.
I would never name any control like this. Is there a way to control how Seam generates object names?