On Tue, 22 Nov 2005 16:10:23 +0100, Anders Peterson <[EMAIL PROTECTED]> wrote:

Hi,

There are a couple of things I don't understand.

1) I have a form using a CompoundPropertyModel with a HashMap as the initial model object. When I later (after having made a choice in a DropDownChoice) call

this.getForm().setModelObject(aNewModelObject);

nothing in the gui is updated. Typically I have components declared like

tmpForm.add(new TextField(ID_SPAN));

that I'd like to have updated.

Component.setModelObject(Object obj) does call IModel.setObject(this,obj). The CompountPropertyModel than takes the id of the component and interprets it as a bean expression into the underlying Object (or in case the the CoumpoundPropertyModel wraps another model the Object from the wrapped model).

So in your case:
==>form.setModelObject(aNew)==>CompoundPropModel.setObject(form,aNew)==>map.put(form.getId(),aNew);

There are a few solutions (and others):
1.) keep the underlying map in an instance variable und access it (in case you do not use
detachable things).
2.) use form.getModel().setObject(null,new Map())


2) In the same page I (sometimes) get an exception like the one below. What requires the DiffusionProcess class to be serializable?

DiffusionProcess is used to do some calculations, and instances are cached in objects used as model objects.

Generally if you do not provide a IModel (or subclass) which does not load on each new Request a newly the underlying Object than the Object must be serializable, because than the Object gets saved into the session.

Please read the wiki how-to entry. This and the above is well explaind there.
http://www.wicket-wiki.org.uk/wiki/index.php/Models

Christian.

/Anders



--
Christian Essl
        

        
                
___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to