The ListView is not in a form, which is why I am leaving the default for
setReuseItems to false.
I am using a LoadableDetachableModel and verified the load that rereads
the cookies, does in fact get called after I delete them (reset method
call below).  If I break in the load of the detachable model, it is
reading that there are still values for the cookies I deleted in the
previous step.

Basically, here is the body of my Ajax Link's onClick,

RecentlyViewedItemsCollection c = new
RecentlyViewedItemsCollection(util.getCurrentUser());
                                c.reset(); // this actually deletes all the 
cookies
                                getModel().detach(); // this forces the 
detachable model to call its
load, which attempts to re-read specific cookies that should no longer
                        exist
                                
target.add(RecentlyViewedItemsPanel.this.get("itemContainer")); //
lastly, I refresh the parent (WebMarkupContainer) of the ListView

I would have expected that when the model's load method is called that it
would see that the cookies were removed, but it still finds them.

J.D.








On 12/6/12 3:29 PM, "Sebastien" <[email protected]> wrote:

>Hi,
>
>Be sure to use a LoadableDetachableModel
>Also, maybe you set ListView#*setReuseItems* to true (because the ListView
>is in a form)? You can set it to false if you have no validation and then
>you will get fresh data (see ListView javadoc)
>
>Hope this helps,
>Sebastien.
>
>On Thu, Dec 6, 2012 at 11:09 PM, Corbin, James
><[email protected]>wrote:
>
>> I have a ListView that renders items that are populated from user cookie
>> data.  The ListView contains a "clear" action that is supposed to delete
>> the cookies then refresh the ListView so it reflects that the cookie
>>data
>> was removed.  I have code that executes the deletion of the cookies
>> (works), then I turn around and detach the ListView's model which
>>triggers
>> a rereading of the cookie data.  For some reason (probably works as
>> designed), when the model is detach and reloads the cookies, they are
>>still
>> present.
>> If I then force a page refresh, cookie data is in fact removed and the
>> ListView is empty.
>>
>> Is there a way to attain this?  Am I missing something?  I really don't
>> want to have to reload the page to see that the cookie data has been
>> removed.
>>
>> J.D.
>>
>>
>>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to