Bugger me, I 've came across with setReuseItem when I had a different issue with ListView but forgot all about it.
Shouldn't spend too much on soccer channel :)


Appreciate for your quick response, it works!


Cheers,
Michael


Eelco Hillenius <[EMAIL PROTECTED]> wrote:
If you did listView.setReuseItems(true), which is a good choice when
you embed a ListView in a form, you should manually 'update' the list
view by calling listView.removeAll, which will trigger the list view
to get all the fresh results again and build the list items from
scratch.

If you use ListView with the default options, (or
setReuseItems(false)), you don't have to do that. However, if you
passed in an actual List, that list itself might be stale. A better
pattern typically is:

IModel myListModel = new LoadableDetachableModel() {
protected Object load() {
return someServiceOrDao.findSomeListOfObjects();
}
};

so that the list is refreshed every request. Of course, this might
lead to issues if you have multiple clients working (adding/ removing)
on the same data if reuseItems == true, but for the default cases,
like displaying some records with delete button, this works excellent.

Eelco


On 7/6/06, Michael K <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm not sure if this problem I'm dealing with have something to do with
> Wicket or Cayenne.
> A bit of a background, I'm using Wicket and Cayenne ORM to build a simple
> CRUD application.
> I want to be able to select and delete a record from the list (using
> ListView component) and then redirect back to the list to display the
> update.
> The problem I had is whenever I delete a record, wicket re-render the
> listview component. The list was taken from the original list including the
> deleted object. Thus, a null pointer exception was thrown by Cayenne because
> the deleted object was called.
>
> Does setResponsePage(...) trigger Wicket to re-render from cached or does it
> re-initialise the entire page?
> if option 1 is valid, is there any chance to tell wicket to drop the cache's
> model and re-init instead?
>
> Thank you.
>
> Michael
>
>
> ________________________________
> Want to be your own boss? Learn how on Yahoo! Small Business.
>
>
> 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

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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