You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Skorpien126 <lo...@web.de> on 2007/04/04 16:55:06 UTC
Validation.setFormComponent works only Once???
Why does this Code in my RegisterPage doesn´t work:
IFormComponent componentPassword = (IFormComponent)
getComponent("password");
IFormComponent componentPasswordConfirm = (IFormComponent)
getComponent("passwordConfirm");
if (!StringUtils.equals(getPassword(),getPasswordConfirm()))
{
getDelegate().setFormComponent(componentPassword);
getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
getDelegate().setFormComponent(componentPasswordConfirm);
getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
}
//check if there is an error... in password confirm or other input
fields... if yes
if (getDelegate().getHasErrors())
{
getDelegate().setFormComponent(componentPassword);
getDelegate().recordFieldInputValue(null);
getDelegate().setFormComponent(componentPasswordConfirm);
getDelegate().recordFieldInputValue(null);
return;
}
whereas this works.
if (!StringUtils.equals(getPassword(),getPasswordConfirm()))
{
getDelegate().setFormComponent(componentPassword);
getDelegate().recordFieldInputValue(null);
getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
getDelegate().setFormComponent(componentPasswordConfirm);
getDelegate().recordFieldInputValue(null);
getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
}
it seems so strength....
--
View this message in context: http://www.nabble.com/Validation.setFormComponent-works-only-Once----tf3526275.html#a9838661
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Validation.setFormComponent works only Once???
Posted by Skorpien126 <lo...@web.de>.
Ok found a Solution...
a cycle().commitPageChanges() dit the Job....
quess that a getDelegate().record(***) also calls cycle.commitChanges()...
not sure why getDelegate().recordFieldInputValue(null); doesnt do.
Skorpien126 wrote:
>
> Why does this Code in my RegisterPage doesn´t work:
>
> IFormComponent componentPassword = (IFormComponent)
> getComponent("password");
> IFormComponent componentPasswordConfirm = (IFormComponent)
> getComponent("passwordConfirm");
>
> if (!StringUtils.equals(getPassword(),getPasswordConfirm()))
> {
> getDelegate().setFormComponent(componentPassword);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
>
> getDelegate().setFormComponent(componentPasswordConfirm);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
> }
>
> //check if there is an error... in password confirm or other input
> fields... if yes
> if (getDelegate().getHasErrors())
> {
> getDelegate().setFormComponent(componentPassword);
> getDelegate().recordFieldInputValue(null);
>
> getDelegate().setFormComponent(componentPasswordConfirm);
> getDelegate().recordFieldInputValue(null);
> return;
> }
>
> whereas this works.
>
> if (!StringUtils.equals(getPassword(),getPasswordConfirm()))
> {
> getDelegate().setFormComponent(componentPassword);
> getDelegate().recordFieldInputValue(null);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
>
> getDelegate().setFormComponent(componentPasswordConfirm);
> getDelegate().recordFieldInputValue(null);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
> }
>
> it seems so strength....
>
>
--
View this message in context: http://www.nabble.com/Validation.setFormComponent-works-only-Once----tf3526275.html#a9853301
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Validation.setFormComponent works only Once???
Posted by Skorpien126 <lo...@web.de>.
Hmm more strange ... why doesnt stop Eclipse at
getDelegate().setFormComponent(****);
when there is set a breakPoint?!?!?.
I know the Code looks the same, but that´s not true.
Skorpien126 wrote:
>
> Why does this Code in my RegisterPage doesn´t work:
>
> IFormComponent componentPassword = (IFormComponent)
> getComponent("password");
> IFormComponent componentPasswordConfirm = (IFormComponent)
> getComponent("passwordConfirm");
>
> if (!StringUtils.equals(getPassword(),getPasswordConfirm()))
> {
> getDelegate().setFormComponent(componentPassword);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
>
> getDelegate().setFormComponent(componentPasswordConfirm);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
> }
>
> //check if there is an error... in password confirm or other input
> fields... if yes
> if (getDelegate().getHasErrors())
> {
> getDelegate().setFormComponent(componentPassword);
> getDelegate().recordFieldInputValue(null);
>
> getDelegate().setFormComponent(componentPasswordConfirm);
> getDelegate().recordFieldInputValue(null);
> return;
> }
>
> whereas this works.
>
> if (!StringUtils.equals(getPassword(),getPasswordConfirm()))
> {
> getDelegate().setFormComponent(componentPassword);
> getDelegate().recordFieldInputValue(null);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
>
> getDelegate().setFormComponent(componentPasswordConfirm);
> getDelegate().recordFieldInputValue(null);
>
> getDelegate().record(getText("validator.passwordMissmatch"),ValidationConstraint.CONSISTENCY);
> }
>
> it seems so strength....
>
>
--
View this message in context: http://www.nabble.com/Validation.setFormComponent-works-only-Once----tf3526275.html#a9852320
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org