CompoundPropertyModel need to track changes

2008-04-14 Thread Karen Schaper
Hi,

I am using a CompoundPropertyModel.

CompoundPropertyModel personModel  = new CompoundPropertyModel(
person );
Form_editForm= new EditPersonForm( 
editForm,
personModel ) ;

Upon submitting the form, I thought that the setter methods would be called
on the person object. How is the person object updated?  The code in the
setter methods of person are not called.

Am I missing something?

I want to track changes in my object and I wanted to check for the change in
the setter methods of the person object.

Thanks for any help.  It is greatly appreciated!

Karen




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CompoundPropertyModel need to track changes

2008-04-14 Thread Maurice Marrink
Hmm, it should try to use bean methods before trying the field directly.
you could try changing the wicket id of your formcomponent to the full
method name, e.g. setLastname() if your property is lastname.
If that does not work, it might indicate a problem with your getters
and setters.

An alternative way to intercept changes (only those coming through the
compoundmodel) is to override
CompoundPropertyModel#wrapOnInheritance(Component) and return a model
similar to AttachedCompoundPropertyModel where you overwrite the
setObject method to listen for changes. Unfortunately you cannot
extend it because it is private so you have to copy paste it.

Maurice

On Mon, Apr 14, 2008 at 5:37 AM, Karen Schaper
[EMAIL PROTECTED] wrote:
 Hi,

  I am using a CompoundPropertyModel.

  CompoundPropertyModel personModel  = new CompoundPropertyModel(
  person );
  Form_editForm= new EditPersonForm( 
 editForm,
  personModel ) ;

  Upon submitting the form, I thought that the setter methods would be called
  on the person object. How is the person object updated?  The code in the
  setter methods of person are not called.

  Am I missing something?

  I want to track changes in my object and I wanted to check for the change in
  the setter methods of the person object.

  Thanks for any help.  It is greatly appreciated!

  Karen




  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CompoundPropertyModel need to track changes

2008-04-14 Thread Gerolf Seitz
On Mon, Apr 14, 2008 at 1:05 PM, Maurice Marrink [EMAIL PROTECTED] wrote:

 Hmm, it should try to use bean methods before trying the field directly.
 you could try changing the wicket id of your formcomponent to the full
 method name, e.g. setLastname() if your property is lastname.
 If that does not work, it might indicate a problem with your getters
 and setters.


it could also be that he only provided a getter or a setter and not both.
in this case, the field is accessed directly.

  Gerolf



 An alternative way to intercept changes (only those coming through the
 compoundmodel) is to override
 CompoundPropertyModel#wrapOnInheritance(Component) and return a model
 similar to AttachedCompoundPropertyModel where you overwrite the
 setObject method to listen for changes. Unfortunately you cannot
 extend it because it is private so you have to copy paste it.

 Maurice

 On Mon, Apr 14, 2008 at 5:37 AM, Karen Schaper
 [EMAIL PROTECTED] wrote:
  Hi,
 
   I am using a CompoundPropertyModel.
 
   CompoundPropertyModel personModel  = new CompoundPropertyModel(
   person );
   Form_editForm= new EditPersonForm(
 editForm,
   personModel ) ;
 
   Upon submitting the form, I thought that the setter methods would be
 called
   on the person object. How is the person object updated?  The code in
 the
   setter methods of person are not called.
 
   Am I missing something?
 
   I want to track changes in my object and I wanted to check for the
 change in
   the setter methods of the person object.
 
   Thanks for any help.  It is greatly appreciated!
 
   Karen
 
 
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: CompoundPropertyModel need to track changes

2008-04-14 Thread Karen Schaper
Thanks.  

My class variables for example are _name with the underscore.

and the getter and setter would be setName and getName.

In my form for this page I had included the underscore _name so I think wicket 
was looking for set_Name.  Once I changed the wicket:id to be just name the 
setter setName was called.

Thank you for the clues.



 -Original Message-
 From: Gerolf Seitz [mailto:[EMAIL PROTECTED]
 Sent: Monday, April 14, 2008 7:18 AM
 To: users@wicket.apache.org
 Subject: Re: CompoundPropertyModel need to track changes
 
 
 On Mon, Apr 14, 2008 at 1:05 PM, Maurice Marrink 
 [EMAIL PROTECTED] wrote:
 
  Hmm, it should try to use bean methods before trying the field directly.
  you could try changing the wicket id of your formcomponent to the full
  method name, e.g. setLastname() if your property is lastname.
  If that does not work, it might indicate a problem with your getters
  and setters.
 
 
 it could also be that he only provided a getter or a setter and not both.
 in this case, the field is accessed directly.
 
   Gerolf
 
 
 
  An alternative way to intercept changes (only those coming through the
  compoundmodel) is to override
  CompoundPropertyModel#wrapOnInheritance(Component) and return a model
  similar to AttachedCompoundPropertyModel where you overwrite the
  setObject method to listen for changes. Unfortunately you cannot
  extend it because it is private so you have to copy paste it.
 
  Maurice
 
  On Mon, Apr 14, 2008 at 5:37 AM, Karen Schaper
  [EMAIL PROTECTED] wrote:
   Hi,
  
I am using a CompoundPropertyModel.
  
CompoundPropertyModel personModel  = new CompoundPropertyModel(
person );
Form_editForm= new 
 EditPersonForm(
  editForm,
personModel ) ;
  
Upon submitting the form, I thought that the setter methods would be
  called
on the person object. How is the person object updated?  The code in
  the
setter methods of person are not called.
  
Am I missing something?
  
I want to track changes in my object and I wanted to check for the
  change in
the setter methods of the person object.
  
Thanks for any help.  It is greatly appreciated!
  
Karen
  
  
  
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]