List Info

Thread: how deeply into a bean does myfaces update value references?




how deeply into a bean does myfaces update value references?
user name
2006-07-31 17:59:23




hello everyone,

I have a jsp and backing bean.  The jsp has a field like
<h:inputText  value="#{myBean.foo}"

MyBean.java has the "foo" property, and it also
has a property like

      private MyBean myBean = null;
 with getters and setters

I save a copy of MyBean here before any update so I can
reset or cancel
the update as needed, and restore the original MyBean to
session.

I find if I enter something in the foo field of the jsp, the
foo property
in the
saved original untouched MyBean property is also updated.

Does my faces search a backing bean for all references to a
property
and update all references?  That's what it looks like it's
doing, but is
that what
you see?

Thanks in advance for your help.
Tom



 
This message is intended for the recipient only and is not
meant to be forwarded or distributed in any other format.
This communication is for informational purposes only.  It
is not intended as an offer or solicitation for the purchase
or sale of any financial instrument, or security, or as an
official confirmation of any transaction.  Putnam does not
accept purchase or redemptions of securities, instructions,
or authorizations that are sent via e-mail.   All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without
notice.  Any comments or statements made herein do not
necessarily reflect those of Putnam, LLC (DBA Putnam
Investments) and its subsidiaries and affiliates.  If you
are not the intended recipient of this e-mail, please delete
the e-mail.
how deeply into a bean does myfaces update value references?
user name
2006-07-31 18:07:17
<h:inputText  value="#{myBean.foo}"

On update:
Look for "myBean" in the scoped maps (request,
session, application).

If not found, create a new instance of mybean.
call setFoo() on the instance of my bean.

On 7/31/06, Thomas_Perryputnam.com
<Thomas_Perryputnam.com> wrote:
>
>
>
>
>
> hello everyone,
>
> I have a jsp and backing bean.  The jsp has a field
like
> <h:inputText  value="#{myBean.foo}"
>
> MyBean.java has the "foo" property, and it
also has a property like
>
>       private MyBean myBean = null;
>  with getters and setters
>
> I save a copy of MyBean here before any update so I can
reset or cancel
> the update as needed, and restore the original MyBean
to session.
>
> I find if I enter something in the foo field of the
jsp, the foo property
> in the
> saved original untouched MyBean property is also
updated.
>
> Does my faces search a backing bean for all references
to a property
> and update all references?  That's what it looks like
it's doing, but is
> that what
> you see?
>
> Thanks in advance for your help.
> Tom
>
>
>
>
> This message is intended for the recipient only and is
not meant to be forwarded or distributed in any other
format. This communication is for informational purposes
only.  It is not intended as an offer or solicitation for
the purchase or sale of any financial instrument, or
security, or as an official confirmation of any transaction.
 Putnam does not accept purchase or redemptions of
securities, instructions, or authorizations that are sent
via e-mail.   All market prices, data and other information
are not warranted as to completeness or accuracy and are
subject to change without notice.  Any comments or
statements made herein do not necessarily reflect those of
Putnam, LLC (DBA Putnam Investments) and its subsidiaries
and affiliates.  If you are not the intended recipient of
this e-mail, please delete the e-mail.
>
how deeply into a bean does myfaces update value references?
user name
2006-07-31 20:22:53





Andrew,

would myfaces also find the property 'MyBean mybean' 
which is defined in
MyBean and call
setFoo on that reference?

for example, I've got

MyBean class
      private String foo  (with getters and setters)
      private MyBean myBean (with getters and setters

before the update page renders, I save a copy of MyBean in
itself.

so the MyBean copy also has a foo reference.

what it looks like is that when the page is submitted,
myfaces updates the
visible
foo property but also find the foo property in the 'MyBean
myBean'
property.

does that make sense? and is that the intended behavior of
Myfaces?

I'm keeping a copy of the bean in itself to be able to
reset the update
form.

I know a Reset button of type=reset works, but on this page
there are lists
which could cause a form submit and I can't reset the
update form to
the original state.

Thank you for the response.
Tom



                                                            
              
             "Andrew Robinson"                  
                          
             <andrew.rw.robins                           
                 
             ongmail.com>                             
                To 
                                       "MyFaces
Discussion"                
             07/31/2006 02:07          <usersmyfaces.apache.org>          
             PM                                             
           cc 
                                                            
              
                                                            
      Subject 
             Please respond to         Re: how deeply into a
bean does     
                 "MyFaces              myfaces update
value references?    
                Discussion"                           
                    
             <usersmyfaces.ap                                
            
                 ache.org>                               
                 
                                                            
              
                                                            
              
                                                            
              




<h:inputText  value="#{myBean.foo}"

On update:
Look for "myBean" in the scoped maps (request,
session, application).

If not found, create a new instance of mybean.
call setFoo() on the instance of my bean.

On 7/31/06, Thomas_Perryputnam.com
<Thomas_Perryputnam.com> wrote:
>
>
>
>
>
> hello everyone,
>
> I have a jsp and backing bean.  The jsp has a field
like
> <h:inputText  value="#{myBean.foo}"
>
> MyBean.java has the "foo" property, and it
also has a property like
>
>       private MyBean myBean = null;
>  with getters and setters
>
> I save a copy of MyBean here before any update so I can
reset or cancel
> the update as needed, and restore the original MyBean
to session.
>
> I find if I enter something in the foo field of the
jsp, the foo property
> in the
> saved original untouched MyBean property is also
updated.
>
> Does my faces search a backing bean for all references
to a property
> and update all references?  That's what it looks like
it's doing, but is
> that what
> you see?
>
> Thanks in advance for your help.
> Tom
>
>
>
>
> This message is intended for the recipient only and is
not meant to be
forwarded or distributed in any other format. This
communication is for
informational purposes only.  It is not intended as an offer
or
solicitation for the purchase or sale of any financial
instrument, or
security, or as an official confirmation of any transaction.
 Putnam does
not accept purchase or redemptions of securities,
instructions, or
authorizations that are sent via e-mail.   All market
prices, data and
other information are not warranted as to completeness or
accuracy and are
subject to change without notice.  Any comments or
statements made herein
do not necessarily reflect those of Putnam, LLC (DBA Putnam
Investments)
and its subsidiaries and affiliates.  If you are not the
intended recipient
of this e-mail, please delete the e-mail.
>




 
This message is intended for the recipient only and is not
meant to be forwarded or distributed in any other format.
This communication is for informational purposes only.  It
is not intended as an offer or solicitation for the purchase
or sale of any financial instrument, or security, or as an
official confirmation of any transaction.  Putnam does not
accept purchase or redemptions of securities, instructions,
or authorizations that are sent via e-mail.   All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without
notice.  Any comments or statements made herein do not
necessarily reflect those of Putnam, LLC (DBA Putnam
Investments) and its subsidiaries and affiliates.  If you
are not the intended recipient of this e-mail, please delete
the e-mail.
how deeply into a bean does myfaces update value references?
user name
2006-07-31 21:40:26
It should never look for (or set)
"myBean.myBean" unless you use it
somewhere in the EL or have it as a managed property in the
faces
config. What code (including EL and managed properties)
refers to the
"myBean" property?

On 7/31/06, Thomas_Perryputnam.com
<Thomas_Perryputnam.com> wrote:
>
>
>
>
>
>
> Andrew,
>
> would myfaces also find the property 'MyBean mybean' 
which is defined in
> MyBean and call
> setFoo on that reference?
>
> for example, I've got
>
> MyBean class
>       private String foo  (with getters and setters)
>       private MyBean myBean (with getters and setters
>
> before the update page renders, I save a copy of MyBean
in itself.
>
> so the MyBean copy also has a foo reference.
>
> what it looks like is that when the page is submitted,
myfaces updates the
> visible
> foo property but also find the foo property in the
'MyBean myBean'
> property.
>
> does that make sense? and is that the intended behavior
of Myfaces?
>
> I'm keeping a copy of the bean in itself to be able to
reset the update
> form.
>
> I know a Reset button of type=reset works, but on this
page there are lists
> which could cause a form submit and I can't reset the
update form to
> the original state.
>
> Thank you for the response.
> Tom
>
>
>
>
>              "Andrew Robinson"
>              <andrew.rw.robins
>              ongmail.com>                             
                To
>                                        "MyFaces
Discussion"
>              07/31/2006 02:07          <usersmyfaces.apache.org>
>              PM                                        
                cc
>
>                                                        
           Subject
>              Please respond to         Re: how deeply
into a bean does
>                  "MyFaces              myfaces
update value references?
>                 Discussion"
>              <usersmyfaces.ap
>                  ache.org>
>
>
>
>
>
>
>
> <h:inputText  value="#{myBean.foo}"
>
> On update:
> Look for "myBean" in the scoped maps
(request, session, application).
>
> If not found, create a new instance of mybean.
> call setFoo() on the instance of my bean.
>
> On 7/31/06, Thomas_Perryputnam.com
<Thomas_Perryputnam.com> wrote:
> >
> >
> >
> >
> >
> > hello everyone,
> >
> > I have a jsp and backing bean.  The jsp has a
field like
> > <h:inputText  value="#{myBean.foo}"
> >
> > MyBean.java has the "foo" property,
and it also has a property like
> >
> >       private MyBean myBean = null;
> >  with getters and setters
> >
> > I save a copy of MyBean here before any update so
I can reset or cancel
> > the update as needed, and restore the original
MyBean to session.
> >
> > I find if I enter something in the foo field of
the jsp, the foo property
> > in the
> > saved original untouched MyBean property is also
updated.
> >
> > Does my faces search a backing bean for all
references to a property
> > and update all references?  That's what it looks
like it's doing, but is
> > that what
> > you see?
> >
> > Thanks in advance for your help.
> > Tom
> >
> >
> >
> >
> > This message is intended for the recipient only
and is not meant to be
> forwarded or distributed in any other format. This
communication is for
> informational purposes only.  It is not intended as an
offer or
> solicitation for the purchase or sale of any financial
instrument, or
> security, or as an official confirmation of any
transaction.  Putnam does
> not accept purchase or redemptions of securities,
instructions, or
> authorizations that are sent via e-mail.   All market
prices, data and
> other information are not warranted as to completeness
or accuracy and are
> subject to change without notice.  Any comments or
statements made herein
> do not necessarily reflect those of Putnam, LLC (DBA
Putnam Investments)
> and its subsidiaries and affiliates.  If you are not
the intended recipient
> of this e-mail, please delete the e-mail.
> >
>
>
>
>
>
> This message is intended for the recipient only and is
not meant to be forwarded or distributed in any other
format. This communication is for informational purposes
only.  It is not intended as an offer or solicitation for
the purchase or sale of any financial instrument, or
security, or as an official confirmation of any transaction.
 Putnam does not accept purchase or redemptions of
securities, instructions, or authorizations that are sent
via e-mail.   All market prices, data and other information
are not warranted as to completeness or accuracy and are
subject to change without notice.  Any comments or
statements made herein do not necessarily reflect those of
Putnam, LLC (DBA Putnam Investments) and its subsidiaries
and affiliates.  If you are not the intended recipient of
this e-mail, please delete the e-mail.
>
how deeply into a bean does myfaces update value references?
user name
2006-07-31 21:50:03


On 7/31/06, Andrew Robinson <gmail.com">andrew.rw.robinsongmail.com> wrote:
It should never look for (or set) "myBean.myBean&quot; unless you use it
somewhere in the EL or have it as a managed property in the faces
config. What code (including EL and managed properties) refers to the
";myBean&quot; property?

To be more specific, here are a couple of example expressions and what they reference:

#{myBean.foo} references the foo property in the "outer" MyBean instance.

#{myBean.mybean.foo} references the foo property in the "inner" MyBean instance.

In other words, evaluation just follows the path you explicitly specify ... the last element represents the property whose value is updated.

Craig
&nbsp;

On 7/31/06, putnam.com">Thomas_Perryputnam.com <putnam.com">Thomas_Perryputnam.com> wrote:
>;
>
>
>
>
>
> Andrew,
&gt;
> would myfaces also find the property 'MyBean mybean'&nbsp; which is defined in
> MyBean and call
> setFoo on that reference?
>
> for example, I've got
>
&gt; MyBean class
>  ; &nbsp; &nbsp; private String foo &nbsp;(with getters and setters)
&gt; &nbsp; &nbsp;   private MyBean myBean (with getters and setters
&gt;
> before the update page renders, I save a copy of MyBean in itself.
&gt;
> so the MyBean copy also has a foo reference.
>
> what it looks like is that when the page is submitted, myfaces updates the
> visible
&gt; foo property but also find the foo property in the 'MyBean myBean'
&gt; property.
>
> does that make sense? and is that the intended behavior of Myfaces?
&gt;
> I'm keeping a copy of the bean in itself to be able to reset the update
&gt; form.
>
> I know a Reset button of type=reset works, but on this page there are lists
> which could cause a form submit and I can't reset the update form to
> the original state.
>;
> Thank you for the response.
> Tom
>
&gt;
>
&gt;
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;"Andrew Robinson&quot;
>&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;<andrew.rw.robins
>&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;gmail.com">ongmail.com   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  To
&gt; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; "MyFaces Discussion"
>  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; 07/31/2006 02:07 ; &nbsp; &nbsp; &nbsp; &nbsp; <myfaces.apache.org"> usersmyfaces.apache.org&gt;
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;PM   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  cc
>
&gt; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;Subject
> &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; Please respond to &nbsp; &nbsp;   ;  Re: how deeply into a bean does
>  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &quot;MyFaces  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; myfaces update value references?
; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; Discussion"
>  ; &nbsp; &nbsp; &nbsp; &nbsp;   ; <myfaces.ap">usersmyfaces.ap
; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; ache.org&gt;
>
&gt;
>
>;
>
>
>
> <h:inputText  value="#{myBean.foo}&quot;
>
&gt; On update:
&gt; Look for "myBean" in the scoped maps (request, session, application).
>
&gt; If not found, create a new instance of mybean.
&gt; call setFoo() on the instance of my bean.
>
> On 7/31/06, putnam.com">Thomas_Perryputnam.com <putnam.com"> Thomas_Perryputnam.com> wrote:
>; >
> >
> >
> >
> >
> > hello everyone,
> >
> > I have a jsp and backing bean. ; The jsp has a field like
> > <h:inputText  value="#{ myBean.foo}&quot;
> >
> > MyBean.java has the "foo&quot; property, and it also has a property like
> >
> >   ; &nbsp;  private MyBean myBean = null;
> with getters and setters
&gt; >
> > I save a copy of MyBean here before any update so I can reset or cancel
>; > the update as needed, and restore the original MyBean to session.
&gt; >
> > I find if I enter something in the foo field of the jsp, the foo property
> > in the
> > saved original untouched MyBean property is also updated.
&gt; >
> > Does my faces search a backing bean for all references to a property
&gt; > and update all references? &nbsp;That's what it looks like it's doing, but is
> > that what
> > you see?
> >
> > Thanks in advance for your help.
> > Tom
> >
> >
> >
> >
> > This message is intended for the recipient only and is not meant to be
> forwarded or distributed in any other format. This communication is for
> informational purposes only. ; It is not intended as an offer or
> solicitation for the purchase or sale of any financial instrument, or
> security, or as an official confirmation of any transaction. &nbsp;Putnam does
> not accept purchase or redemptions of securities, instructions, or
> authorizations that are sent via e-mail.&nbsp;  All market prices, data and
> other information are not warranted as to completeness or accuracy and are
> subject to change without notice.&nbsp; Any comments or statements made herein
>; do not necessarily reflect those of Putnam, LLC (DBA Putnam Investments)
> and its subsidiaries and affiliates. &nbsp;If you are not the intended recipient
> of this e-mail, please delete the e-mail.
&gt; >
>
>
>
&gt;
>
&gt; This message is intended for the recipient only and is not meant to be forwarded or distributed in any other format. This communication is for informational purposes only. ; It is not intended as an offer or solicitation for the purchase or sale of any financial instrument, or security, or as an official confirmation of any transaction. &nbsp;Putnam does not accept purchase or redemptions of securities, instructions, or authorizations that are sent via e-mail.&nbsp;  All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice.&nbsp; Any comments or statements made herein do not necessarily reflect those of Putnam, LLC (DBA Putnam Investments) and its subsidiaries and affiliates. &nbsp;If you are not the intended recipient of this e-mail, please delete the e-mail.
&gt;

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )