[
https://jira.jboss.org/jira/browse/JBSEAM-3676?page=com.atlassian.jira.pl...
]
Ingo Jobling commented on JBSEAM-3676:
--------------------------------------
Problem is that EqualityValidator line 74 cannot find the component
UIComponent otherComponent = component.findComponent(forId);
As per JSF 1.2 API, findComponent will search up the parents of this component. If a
NamingContainer is encountered, it will be the base for the search.
Since s:decorate implements the NamingContainer interface, findComponent fails to locate
the Id, and returns null, resulting in the exception seen above.
A workaround is to specifiy the full client id, with a leading ":", like this:
<s:validateEquality for=":#{rich:clientId('password')}" />
This results in something similiar to for=":user:j_id174:password"
s:validateEquality doesn't work in s:decorate
---------------------------------------------
Key: JBSEAM-3676
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3676
Project: Seam
Issue Type: Bug
Components: JSF Controls
Affects Versions: 2.1.0.SP1
Environment: JBoss 4.2.2 with Java 1.5 (Mac Os X)
Reporter: Frederic Nauleau
Priority: Minor
Hello,
I have dicovered the s:validateEquality control. It's perfect for email and password
double check.
I have a problem, if the tags are in a s:decorate template... The validation failed with
this exception:
Caused by: java.lang.IllegalStateException: forId must reference an EditableValueHolder
("input") component
at
org.jboss.seam.ui.validator.EqualityValidator$OtherComponent.<init>(EqualityValidator.java:168)
at org.jboss.seam.ui.validator.EqualityValidator.validate(EqualityValidator.java:74)
at org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:35)
at javax.faces.component.UIInput.validate(UIInput.java:867)
This code is working:
<h:inputText id="emailInput" value="#{classicUser.email}"
required="true">
<s:validate />
</h:inputText>
<h:inputText id="emailInputVerification">
<s:validateEquality message="Mails must be identical"
for="emailInput" />
</h:inputText>
This code is not working
<s:decorate ...>
<h:inputText id="emailInput" value="#{classicUser.email}"
required="true">
<s:validate />
</h:inputText>
</s:decorate>
<s:decorate ...>
<h:inputText id="emailInputVerification">
<s:validateEquality message="Mails must be identical"
for="emailInput" />
</h:inputText>
</s:decorate>
Regards
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira