You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Hendrikx <hj...@xs4all.nl> on 2009/04/25 01:46:45 UTC

FeedbackMessage filter uses old components?

First, I'm new to Wicket.

I think however I'm either doing something fundamentally wrong or I may 
have discovered a problem with how ContainerFeedbackMessageFilter checks 
which Feedbacks to "accept".

Short version:

Using the debugger I found that the DateTextField being passed to the 
accept function has the id of the just submitted page, which it then is 
trying to match to the new component hierarchy (which has completely 
different id's).  Of course, it will never find this "stale id" and thus 
the feedback message is not added to the proper panel (the panel without 
filter works fine, as soon as I filter it, it stops working).

The long version:

I've got a page that displays several lists of dates + some other data.  
Like so:

Title of List 1
12-01-2008 <other data>
13-01-2008 <other data>
14-01-2008 <other data>
 (hidden feedback panel)

Title of List 2
12-01-2008 <other data>
13-01-2008 <other data>
14-01-2008 <other data>
  (hidden feedback panel)

So it's basically 2 ListView's nested inside each other.  Every row of 
data has an edit button, which changes the row into editable form.  Only 
one row is editable at a time, so there's only one DateTextField 
component (the rest are just labels).  I added the FeedbackPanel to a 
form object which surrounds each List (so the page has 2 forms), and 
filter it by using the reference to the form using a 
ContainerFeedbackMessageFilter.

With the debugger I can clearly see that a DateTextField message is 
being passed to this filter, but is has the wrong id (id is 106 for 
example). In the hierarchy of components, I could only find a 
DateTextField with id = 203, and so there is no match to be found.  
Ignoring the problem and submitting the form again, results in the 
filter being passed a DateTextField with id = 203 which existed in the 
previous tree of components, but not anymore in the new one... and so on...

Now, every time the page reloads, Wicket recreates the Form class that I 
use for these components (it contains all the ListViews).  I assume that 
is normal behaviour, but perhaps it isn't and that's what is causing my 
problems.

Any help would be appreciated :)

--John


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackMessage filter uses old components?

Posted by John Hendrikx <hj...@xs4all.nl>.
That fixed my problem.  After making the change I had to do a 
removeAll() on the ListView as well every time a row changes from 
read-only to editable form or vice versa, but it's working as I had 
intended now.

Thanks!
--John


Igor Vaynberg wrote:
> did you call setreuseitems(true) on your listviews?
>
> -igor
>
> On Fri, Apr 24, 2009 at 4:46 PM, John Hendrikx <hj...@xs4all.nl> wrote:
>   
>> First, I'm new to Wicket.
>>
>> I think however I'm either doing something fundamentally wrong or I may have
>> discovered a problem with how ContainerFeedbackMessageFilter checks which
>> Feedbacks to "accept".
>>
>> Short version:
>>
>> Using the debugger I found that the DateTextField being passed to the accept
>> function has the id of the just submitted page, which it then is trying to
>> match to the new component hierarchy (which has completely different id's).
>>  Of course, it will never find this "stale id" and thus the feedback message
>> is not added to the proper panel (the panel without filter works fine, as
>> soon as I filter it, it stops working).
>>
>> The long version:
>>
>> I've got a page that displays several lists of dates + some other data.
>>  Like so:
>>
>> Title of List 1
>> 12-01-2008 <other data>
>> 13-01-2008 <other data>
>> 14-01-2008 <other data>
>> (hidden feedback panel)
>>
>> Title of List 2
>> 12-01-2008 <other data>
>> 13-01-2008 <other data>
>> 14-01-2008 <other data>
>>  (hidden feedback panel)
>>
>> So it's basically 2 ListView's nested inside each other.  Every row of data
>> has an edit button, which changes the row into editable form.  Only one row
>> is editable at a time, so there's only one DateTextField component (the rest
>> are just labels).  I added the FeedbackPanel to a form object which
>> surrounds each List (so the page has 2 forms), and filter it by using the
>> reference to the form using a ContainerFeedbackMessageFilter.
>>
>> With the debugger I can clearly see that a DateTextField message is being
>> passed to this filter, but is has the wrong id (id is 106 for example). In
>> the hierarchy of components, I could only find a DateTextField with id =
>> 203, and so there is no match to be found.  Ignoring the problem and
>> submitting the form again, results in the filter being passed a
>> DateTextField with id = 203 which existed in the previous tree of
>> components, but not anymore in the new one... and so on...
>>
>> Now, every time the page reloads, Wicket recreates the Form class that I use
>> for these components (it contains all the ListViews).  I assume that is
>> normal behaviour, but perhaps it isn't and that's what is causing my
>> problems.
>>
>> Any help would be appreciated :)
>>
>> --John
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackMessage filter uses old components?

Posted by Igor Vaynberg <ig...@gmail.com>.
did you call setreuseitems(true) on your listviews?

-igor

On Fri, Apr 24, 2009 at 4:46 PM, John Hendrikx <hj...@xs4all.nl> wrote:
> First, I'm new to Wicket.
>
> I think however I'm either doing something fundamentally wrong or I may have
> discovered a problem with how ContainerFeedbackMessageFilter checks which
> Feedbacks to "accept".
>
> Short version:
>
> Using the debugger I found that the DateTextField being passed to the accept
> function has the id of the just submitted page, which it then is trying to
> match to the new component hierarchy (which has completely different id's).
>  Of course, it will never find this "stale id" and thus the feedback message
> is not added to the proper panel (the panel without filter works fine, as
> soon as I filter it, it stops working).
>
> The long version:
>
> I've got a page that displays several lists of dates + some other data.
>  Like so:
>
> Title of List 1
> 12-01-2008 <other data>
> 13-01-2008 <other data>
> 14-01-2008 <other data>
> (hidden feedback panel)
>
> Title of List 2
> 12-01-2008 <other data>
> 13-01-2008 <other data>
> 14-01-2008 <other data>
>  (hidden feedback panel)
>
> So it's basically 2 ListView's nested inside each other.  Every row of data
> has an edit button, which changes the row into editable form.  Only one row
> is editable at a time, so there's only one DateTextField component (the rest
> are just labels).  I added the FeedbackPanel to a form object which
> surrounds each List (so the page has 2 forms), and filter it by using the
> reference to the form using a ContainerFeedbackMessageFilter.
>
> With the debugger I can clearly see that a DateTextField message is being
> passed to this filter, but is has the wrong id (id is 106 for example). In
> the hierarchy of components, I could only find a DateTextField with id =
> 203, and so there is no match to be found.  Ignoring the problem and
> submitting the form again, results in the filter being passed a
> DateTextField with id = 203 which existed in the previous tree of
> components, but not anymore in the new one... and so on...
>
> Now, every time the page reloads, Wicket recreates the Form class that I use
> for these components (it contains all the ListViews).  I assume that is
> normal behaviour, but perhaps it isn't and that's what is causing my
> problems.
>
> Any help would be appreciated :)
>
> --John
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org