You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by David Brunette <Da...@chordiant.com> on 2007/01/09 17:02:32 UTC

immediate="true" is ignored when auto submitting input components

 

     Hi everybody.  I have created the following bug:
https://issues.apache.org/jira/browse/ADFFACES-349.  If I have a simple
page with, for example, a <tr:selectOneChoice autoSubmit="true"
immediate="true" />, whenever I change the value of the dropdown, I am
getting a error messages for all of the other components in that page
that are required or have other validation errors... even though I have
set immediate="true".  This attribute seems to be ignored.

 

     I have looked into the UIXEditableValue class, and is seems to be a
simple mistake in the processDecodes() method... it is calling:

 

if( isImmedate() )

   _executeValidate(context);

 

     That seems backwards, and a '!' should probably be put into the if
condition so that the validations are executed if the component is NOT
immedate.  But then I noticed that the _executeValidate() method is also
being called by the processValidations() method of this same class.
Does it make sense that we are executing the validations twice?  I would
think that we only wanted to do that once, but I do not know if there is
an actual reason for having this call in both methods.

 

     I have not submitted a patch to the bug I created because I would
first like to know if the proper fix is to 1) fix the if condition in
the processDecodes() method, or 2) remove the call to _executeValidate()
from the processDecodes() method and just let processValidations()
handle it.  Any suggestions are welcome.  Thanks...

 

Dave

The information transmitted herewith is sensitive      information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

RE: immediate="true" is ignored when auto submitting input components

Posted by David Brunette <Da...@chordiant.com>.
     OK then... I stand corrected!  I knew that the immediate="true" was
used to skip validation on command components, and mistakenly thought
that it did the same for auto submitting editable values.

     Thanks for the help.  I'll move on with your suggestion...

Dave

-----Original Message-----
From: Adam Winer [mailto:awiner@gmail.com] 
Sent: Tuesday, January 09, 2007 1:03 PM
To: adffaces-dev@incubator.apache.org
Subject: Re: immediate="true" is ignored when auto submitting input
components

No, the code in UIXEditableValue is 100% correct, and
there are no double validations, and this has nothing
to do with any of the problems you're seeing.

If "immediate" is true on an EditableValueHolder, it means that
validation moves up from Process Validators to
Apply Request Values;  that's exactly what the code does.

The bug is invalid - what you need to do is call
FacesContext.renderResponse() from a
valueChangeListener, to avoid continuing the lifecycle.

-- Adam


On 1/9/07, David Brunette <Da...@chordiant.com> wrote:
>
>
>      Hi everybody.  I have created the following bug:
> https://issues.apache.org/jira/browse/ADFFACES-349.  If I have a
simple
> page with, for example, a <tr:selectOneChoice autoSubmit="true"
> immediate="true" />, whenever I change the value of the dropdown, I am
> getting a error messages for all of the other components in that page
> that are required or have other validation errors... even though I
have
> set immediate="true".  This attribute seems to be ignored.
>
>
>
>      I have looked into the UIXEditableValue class, and is seems to be
a
> simple mistake in the processDecodes() method... it is calling:
>
>
>
> if( isImmedate() )
>
>    _executeValidate(context);
>
>
>
>      That seems backwards, and a '!' should probably be put into the
if
> condition so that the validations are executed if the component is NOT
> immedate.  But then I noticed that the _executeValidate() method is
also
> being called by the processValidations() method of this same class.
> Does it make sense that we are executing the validations twice?  I
would
> think that we only wanted to do that once, but I do not know if there
is
> an actual reason for having this call in both methods.
>
>
>
>      I have not submitted a patch to the bug I created because I would
> first like to know if the proper fix is to 1) fix the if condition in
> the processDecodes() method, or 2) remove the call to
_executeValidate()
> from the processDecodes() method and just let processValidations()
> handle it.  Any suggestions are welcome.  Thanks...
>
>
>
> Dave
>
> The information transmitted herewith is sensitive      information of
Chordiant Software or its customers and is intended only for use to the
individual or entity to which it is addressed. If the reader of this
message is not the intended recipient, you are hereby notified that any
review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon, this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.
>
>
The information transmitted herewith is sensitive      information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.

Re: immediate="true" is ignored when auto submitting input components

Posted by Adam Winer <aw...@gmail.com>.
No, the code in UIXEditableValue is 100% correct, and
there are no double validations, and this has nothing
to do with any of the problems you're seeing.

If "immediate" is true on an EditableValueHolder, it means that
validation moves up from Process Validators to
Apply Request Values;  that's exactly what the code does.

The bug is invalid - what you need to do is call
FacesContext.renderResponse() from a
valueChangeListener, to avoid continuing the lifecycle.

-- Adam


On 1/9/07, David Brunette <Da...@chordiant.com> wrote:
>
>
>      Hi everybody.  I have created the following bug:
> https://issues.apache.org/jira/browse/ADFFACES-349.  If I have a simple
> page with, for example, a <tr:selectOneChoice autoSubmit="true"
> immediate="true" />, whenever I change the value of the dropdown, I am
> getting a error messages for all of the other components in that page
> that are required or have other validation errors... even though I have
> set immediate="true".  This attribute seems to be ignored.
>
>
>
>      I have looked into the UIXEditableValue class, and is seems to be a
> simple mistake in the processDecodes() method... it is calling:
>
>
>
> if( isImmedate() )
>
>    _executeValidate(context);
>
>
>
>      That seems backwards, and a '!' should probably be put into the if
> condition so that the validations are executed if the component is NOT
> immedate.  But then I noticed that the _executeValidate() method is also
> being called by the processValidations() method of this same class.
> Does it make sense that we are executing the validations twice?  I would
> think that we only wanted to do that once, but I do not know if there is
> an actual reason for having this call in both methods.
>
>
>
>      I have not submitted a patch to the bug I created because I would
> first like to know if the proper fix is to 1) fix the if condition in
> the processDecodes() method, or 2) remove the call to _executeValidate()
> from the processDecodes() method and just let processValidations()
> handle it.  Any suggestions are welcome.  Thanks...
>
>
>
> Dave
>
> The information transmitted herewith is sensitive      information of Chordiant Software or its customers and is intended only for use to the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon, this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.
>
>