[
https://jira.jboss.org/jira/browse/JBSEAM-4172?page=com.atlassian.jira.pl...
]
Daniel Roth closed JBSEAM-4172.
-------------------------------
Fix Version/s: 2.2.0.CR1
Resolution: Done
Added "required" attribute to validator tag. See documentation. Passes the value
through to the validator. Validate name example modified to show this behavior.
s:validateEquality doesn't work with empty values
-------------------------------------------------
Key: JBSEAM-4172
URL:
https://jira.jboss.org/jira/browse/JBSEAM-4172
Project: Seam
Issue Type: Bug
Components: JSF Controls
Affects Versions: 2.1.2.CR1
Reporter: Yuriy Lazarev
Assignee: Daniel Roth
Fix For: 2.2.0.CR1
Suppose such form elements:
<s:decorate template="/template/form_item.xhtml">
<ui:define name="label">
<h:outputText value="#{messages.old_password}" />
</ui:define>
<h:inputSecret id="old_password"
value="#{updateProfileAction.password}" />
</s:decorate>
<s:decorate template="/template/form_item.xhtml">
<ui:define name="label">
<h:outputText value="#{messages.new_password}" />
</ui:define>
<h:inputSecret id="new_password"
value="#{updateProfileAction.passwordNew}">
<s:validateEquality for="old_password"
messageId="new_password_is_equal_to_old" operator="not_equal" />
</h:inputSecret>
</s:decorate>
<s:decorate template="/template/form_item.xhtml">
<ui:define name="label">
<h:outputText value="#{messages.repeat_new_password}" />
</ui:define>
<h:inputSecret value="#{updateProfileAction.passwordNewRepeat}">
<s:validateEquality for="new_password"
messageId="new_passwords_dont_match" />
<ui:remove>
This component is implicitly required
(org.jboss.seam.ui.renderkit.EqualityValidationRendererBase:46 = evh.setRequired(true);)
It makes impossible to achieve such behavior:
1) If both password fields are blank then its ok - user doesn't want to
change his old password.
2) If there is any text in one of the fields - check if values are equal and
update password only if they are.
</ui:remove>
</h:inputSecret>
</s:decorate>
At the moment validation fails for empty fields as they are required.
--
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