Thank you Frank and Igor,

 > this is where wicket differs from a lot of other frameworks and
 > sometimes its hard to wrap your mind around it: the components are
 > persistent across requests, they keep their state.

Yes, it is somewhat hard !

In fact, I started from an example I found that used a final ListView 
constructed exactly as you describe, but it appears I broke it !

Thank you for pointing me once again in the right direction !

Pierre-Yves

Igor Vaynberg a écrit :
> but why even create a new listview? the old one should just refresh and 
> show new data, if it doesnt you need to use a detachable model.
> 
> this is where wicket differs from a lot of other frameworks and 
> sometimes its hard to wrap your mind around it: the components are 
> persistent across requests, they keep their state.
> 
> so really what you should do is something like this:
> 
> IModel listModel=new LoadableDetachableModel() {
>       Object load() {
>           return DataObjectsFactory.getMyList();
>      }
> }
> final ListView mylistview;
> add(mylistview=new ListView("id", listModel) {
>        populateitem(....) {....}
>        IModel getListItemModel(...) { ... }
> }.setOutputMarkupId(true));
> 
> 
> and then in the ajax handler all you have to do is to add the listview 
> to the target so it is queued for repainting : target.add(mylistview);
> 
> -Igor
> 
> 
> On 8/8/06, *Frank Bille* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
>     On 8/9/06, *Pierre-Yves Saumont* < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
> 
>         myList = DataObjectsFactory.getMyList();
>         myListView = new MyListView("id", myList);
>         myListView.setOutputMarkupId(true);
>         target.addComponent(myListView);
> 
> 
>     It doesn't look like you add/replace that myListView to a parent.
>     OutputMarkupId can't be calculated when it's not attached to a
>     parent. And what more you still need to keep the component hierachy
>     on the server. So basically you would just replace your old listview
>     with this new one.
> 
>     Frank
> 
> 
>     -------------------------------------------------------------------------
>     Using Tomcat but need to do more? Need to support web services,
>     security?
>     Get stuff done quickly with pre-integrated technology to make your
>     job easier
>     Download IBM WebSphere Application Server v.1.0.1 based on Apache
>     Geronimo
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
> 
>     _______________________________________________
>     Wicket-user mailing list
>     Wicket-user@lists.sourceforge.net
>     <mailto:Wicket-user@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/wicket-user
>     <https://lists.sourceforge.net/lists/listinfo/wicket-user>
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to