You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Bjørn T Johansen <bt...@havleik.no> on 2005/08/29 00:46:55 UTC

immediate = true ?

I thought the reason for setting this property to true, was so the submit would skip the
validation phase, but that doesn't work for me...

I have the following...:

<h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
	<f:selectItems value="#{selectMain.listDomain}"/>
</h:selectOneMenu>

<h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
	<f:validateLength minimum="3" maximum="30" />
</h:inputText>

But when I change a value in the drop down box, the validation still occurs...
Does anyone know why?


Regards,

BTJ


-- 
-----------------------------------------------------------------------------------------------
Bjørn T Johansen

btj@havleik.no
-----------------------------------------------------------------------------------------------
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"
-----------------------------------------------------------------------------------------------

Re: immediate = true ?

Posted by Werner Punz <we...@gmx.at>.
Bjørn T Johansen wrote:
> I thought the reason for setting this property to true, was so the submit would skip the
> validation phase, but that doesn't work for me...
> 
> I have the following...:
> 
> <h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
> 	<f:selectItems value="#{selectMain.listDomain}"/>
> </h:selectOneMenu>
> 
> <h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
> 	<f:validateLength minimum="3" maximum="30" />
> </h:inputText>
> 
> But when I change a value in the drop down box, the validation still occurs...
> Does anyone know why?
> 
> 
> Regards,
> 
> BTJ
> 
> 
Does not work that way... but I just had the same problem, there is a 
simple workaround to the validation problem, if you want some kind of 
cancel functionality, just bind the controls which you have to turn off
to the backend bean and if you want to bypass validation turn off
the validation on the controls directly, that way I could get a nice
cancel functionality although several fields of my form were
set to required...


Werner


Re: immediate = true ?

Posted by Mike Kienenberger <mk...@gmail.com>.
On 8/29/05, Mike Kienenberger <mk...@gmail.com> wrote:
> Yes, this doesn't skip the process validation phase so much as execute
> your action in the apply values phase and short-circuit the
> process-validation and update-model phases.

Doh.   I didn't write what I meant.   I meant:

Yes, this doesn't skip validation so much as execute
your action in the apply values phase and short-circuit the
process-validation and update-model phases.

It does skip the process-validation phase.

Re: immediate = true ?

Posted by Mike Kienenberger <mk...@gmail.com>.
Yes, this doesn't skip the process validation phase so much as execute
your action in the apply values phase and short-circuit the
process-validation and update-model phases.

The optional validation framework can allow you to ignore or skip
validations, and I'm currently using it for the same purpose (to
update a page after a pulldown item is selected).

-Mike

On 8/29/05, Sean Schofield <se...@gmail.com> wrote:
> If you use "immediate=true" in a *command* this will cause the
> ProcessValidations phase to be skipped.  (ie. "Cancel" button)
> 
> sean
> 
> On 8/29/05, Bjørn T Johansen <bt...@havleik.no> wrote:
> > Yes, you are absolutely correct... I was sure that I had read somewhere that I could use
> > immediate to skip the validation and I can... But I forgot something... I also need to
> > call renderResponse from my valueChangeListener and now it works... :)
> >
> >
> > BTJ
> >
> > Jonas Jacobi wrote:
> > > Hi Bjorn,
> > >
> > > Directly from the JavaDoc:
> > >
> > > "By default, during the /Process Validators/ phase of the request
> > > processing lifecycle, the submitted value will be converted to a
> > > typesafe object, and, if validation succeeds, stored as a local value
> > > using |setValue()|. However, if the |immediate| property is set to
> > > |true|, this processing will occur instead at the end of the /Apply
> > > Request Values/ phase."
> > >
> > > Meaning that convertion and validation will *instead *occur in the Apply
> > > Request Values phase, not that it will skip convertion/validation.
> > >
> > > Jonas
> > >
> > >
> > > Bjørn T Johansen wrote:
> > >
> > >>I thought the reason for setting this property to true, was so the submit would skip the
> > >>validation phase, but that doesn't work for me...
> > >>
> > >>I have the following...:
> > >>
> > >><h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
> > >>      <f:selectItems value="#{selectMain.listDomain}"/>
> > >></h:selectOneMenu>
> > >>
> > >><h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
> > >>      <f:validateLength minimum="3" maximum="30" />
> > >></h:inputText>
> > >>
> > >>But when I change a value in the drop down box, the validation still occurs...
> > >>Does anyone know why?
> > >>
> > >>
> > >>Regards,
> > >>
> > >>BTJ
> > >>
> > >>
> > >>
> > >>
> > >
> > > --
> > >
> > > -------------------------------------------------------
> > > *Jonas Jacobi
> > > *Principal Product Manager - JSF & ADF Faces
> > > Oracle JDeveloper
> > > *Author*: Pro JSF: Building Rich Internet Components
> > > <http://apress.com/book/bookDisplay.html?bID=10044>
> > > *Blog*: http://www.orablogs.com/jjacobi
> > >
> >
>

Re: immediate = true ?

Posted by Bjørn T Johansen <bt...@havleik.no>.
Yes, nice workaround... Thx... :)

BTJ

Bruno Aranda wrote:
> Bjørn, you can use one of the examples to submit forms when a value is
> changed in the selectOneMenu, explained in
> http://wiki.apache.org/myfaces/SubmitPageOnValueChange and then you
> have to put the attribute="true" in the command button...
> 
> Bruno
> 
> 2005/8/29, Sean Schofield <se...@gmail.com>:
> 
>>If you use "immediate=true" in a *command* this will cause the
>>ProcessValidations phase to be skipped.  (ie. "Cancel" button)
>>
>>sean
>>
>>On 8/29/05, Bjørn T Johansen <bt...@havleik.no> wrote:
>>
>>>Yes, you are absolutely correct... I was sure that I had read somewhere that I could use
>>>immediate to skip the validation and I can... But I forgot something... I also need to
>>>call renderResponse from my valueChangeListener and now it works... :)
>>>

Re: immediate = true ?

Posted by Bruno Aranda <br...@gmail.com>.
Bjørn, you can use one of the examples to submit forms when a value is
changed in the selectOneMenu, explained in
http://wiki.apache.org/myfaces/SubmitPageOnValueChange and then you
have to put the attribute="true" in the command button...

Bruno

2005/8/29, Sean Schofield <se...@gmail.com>:
> If you use "immediate=true" in a *command* this will cause the
> ProcessValidations phase to be skipped.  (ie. "Cancel" button)
> 
> sean
> 
> On 8/29/05, Bjørn T Johansen <bt...@havleik.no> wrote:
> > Yes, you are absolutely correct... I was sure that I had read somewhere that I could use
> > immediate to skip the validation and I can... But I forgot something... I also need to
> > call renderResponse from my valueChangeListener and now it works... :)
> >
> >
> > BTJ
> >
> > Jonas Jacobi wrote:
> > > Hi Bjorn,
> > >
> > > Directly from the JavaDoc:
> > >
> > > "By default, during the /Process Validators/ phase of the request
> > > processing lifecycle, the submitted value will be converted to a
> > > typesafe object, and, if validation succeeds, stored as a local value
> > > using |setValue()|. However, if the |immediate| property is set to
> > > |true|, this processing will occur instead at the end of the /Apply
> > > Request Values/ phase."
> > >
> > > Meaning that convertion and validation will *instead *occur in the Apply
> > > Request Values phase, not that it will skip convertion/validation.
> > >
> > > Jonas
> > >
> > >
> > > Bjørn T Johansen wrote:
> > >
> > >>I thought the reason for setting this property to true, was so the submit would skip the
> > >>validation phase, but that doesn't work for me...
> > >>
> > >>I have the following...:
> > >>
> > >><h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
> > >>      <f:selectItems value="#{selectMain.listDomain}"/>
> > >></h:selectOneMenu>
> > >>
> > >><h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
> > >>      <f:validateLength minimum="3" maximum="30" />
> > >></h:inputText>
> > >>
> > >>But when I change a value in the drop down box, the validation still occurs...
> > >>Does anyone know why?
> > >>
> > >>
> > >>Regards,
> > >>
> > >>BTJ
> > >>
> > >>
> > >>
> > >>
> > >
> > > --
> > >
> > > -------------------------------------------------------
> > > *Jonas Jacobi
> > > *Principal Product Manager - JSF & ADF Faces
> > > Oracle JDeveloper
> > > *Author*: Pro JSF: Building Rich Internet Components
> > > <http://apress.com/book/bookDisplay.html?bID=10044>
> > > *Blog*: http://www.orablogs.com/jjacobi
> > >
> >
>

Re: immediate = true ?

Posted by Sean Schofield <se...@gmail.com>.
If you use "immediate=true" in a *command* this will cause the
ProcessValidations phase to be skipped.  (ie. "Cancel" button)

sean

On 8/29/05, Bjørn T Johansen <bt...@havleik.no> wrote:
> Yes, you are absolutely correct... I was sure that I had read somewhere that I could use
> immediate to skip the validation and I can... But I forgot something... I also need to
> call renderResponse from my valueChangeListener and now it works... :)
> 
> 
> BTJ
> 
> Jonas Jacobi wrote:
> > Hi Bjorn,
> >
> > Directly from the JavaDoc:
> >
> > "By default, during the /Process Validators/ phase of the request
> > processing lifecycle, the submitted value will be converted to a
> > typesafe object, and, if validation succeeds, stored as a local value
> > using |setValue()|. However, if the |immediate| property is set to
> > |true|, this processing will occur instead at the end of the /Apply
> > Request Values/ phase."
> >
> > Meaning that convertion and validation will *instead *occur in the Apply
> > Request Values phase, not that it will skip convertion/validation.
> >
> > Jonas
> >
> >
> > Bjørn T Johansen wrote:
> >
> >>I thought the reason for setting this property to true, was so the submit would skip the
> >>validation phase, but that doesn't work for me...
> >>
> >>I have the following...:
> >>
> >><h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
> >>      <f:selectItems value="#{selectMain.listDomain}"/>
> >></h:selectOneMenu>
> >>
> >><h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
> >>      <f:validateLength minimum="3" maximum="30" />
> >></h:inputText>
> >>
> >>But when I change a value in the drop down box, the validation still occurs...
> >>Does anyone know why?
> >>
> >>
> >>Regards,
> >>
> >>BTJ
> >>
> >>
> >>
> >>
> >
> > --
> >
> > -------------------------------------------------------
> > *Jonas Jacobi
> > *Principal Product Manager - JSF & ADF Faces
> > Oracle JDeveloper
> > *Author*: Pro JSF: Building Rich Internet Components
> > <http://apress.com/book/bookDisplay.html?bID=10044>
> > *Blog*: http://www.orablogs.com/jjacobi
> >
>

Re: immediate = true ?

Posted by Bjørn T Johansen <bt...@havleik.no>.
Yes, you are absolutely correct... I was sure that I had read somewhere that I could use
immediate to skip the validation and I can... But I forgot something... I also need to
call renderResponse from my valueChangeListener and now it works... :)


BTJ

Jonas Jacobi wrote:
> Hi Bjorn,
> 
> Directly from the JavaDoc:
> 
> "By default, during the /Process Validators/ phase of the request
> processing lifecycle, the submitted value will be converted to a
> typesafe object, and, if validation succeeds, stored as a local value
> using |setValue()|. However, if the |immediate| property is set to
> |true|, this processing will occur instead at the end of the /Apply
> Request Values/ phase."
> 
> Meaning that convertion and validation will *instead *occur in the Apply
> Request Values phase, not that it will skip convertion/validation.
> 
> Jonas
> 
> 
> Bjørn T Johansen wrote:
> 
>>I thought the reason for setting this property to true, was so the submit would skip the
>>validation phase, but that doesn't work for me...
>>
>>I have the following...:
>>
>><h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
>>	<f:selectItems value="#{selectMain.listDomain}"/>
>></h:selectOneMenu>
>>
>><h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
>>	<f:validateLength minimum="3" maximum="30" />
>></h:inputText>
>>
>>But when I change a value in the drop down box, the validation still occurs...
>>Does anyone know why?
>>
>>
>>Regards,
>>
>>BTJ
>>
>>
>>  
>>
> 
> -- 
> 
> -------------------------------------------------------
> *Jonas Jacobi
> *Principal Product Manager - JSF & ADF Faces
> Oracle JDeveloper
> *Author*: Pro JSF: Building Rich Internet Components
> <http://apress.com/book/bookDisplay.html?bID=10044>
> *Blog*: http://www.orablogs.com/jjacobi
> 

Re: immediate = true ?

Posted by Jonas Jacobi <jo...@oracle.com>.
Hi Bjorn,

Directly from the JavaDoc:

"By default, during the /Process Validators/ phase of the request 
processing lifecycle, the submitted value will be converted to a 
typesafe object, and, if validation succeeds, stored as a local value 
using |setValue()|. However, if the |immediate| property is set to 
|true|, this processing will occur instead at the end of the /Apply 
Request Values/ phase."

Meaning that convertion and validation will *instead *occur in the Apply 
Request Values phase, not that it will skip convertion/validation.

Jonas


Bjørn T Johansen wrote:

>I thought the reason for setting this property to true, was so the submit would skip the
>validation phase, but that doesn't work for me...
>
>I have the following...:
>
><h:selectOneMenu accesskey="D" value="#{bean.domainID}" immediate="true" onchange="submit();">
>	<f:selectItems value="#{selectMain.listDomain}"/>
></h:selectOneMenu>
>
><h:inputText id="text" value="#{bean.name}" size="40" maxlength="40" required="true">
>	<f:validateLength minimum="3" maximum="30" />
></h:inputText>
>
>But when I change a value in the drop down box, the validation still occurs...
>Does anyone know why?
>
>
>Regards,
>
>BTJ
>
>
>  
>

-- 

-------------------------------------------------------
*Jonas Jacobi
*Principal Product Manager - JSF & ADF Faces
Oracle JDeveloper
*Author*: Pro JSF: Building Rich Internet Components 
<http://apress.com/book/bookDisplay.html?bID=10044>
*Blog*: http://www.orablogs.com/jjacobi