Problem with ListView and Feedback Panel

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with ListView and Feedback Panel

N. Metzger
I'm running Wicket 6.3 and have an approval page where a user can approve certain accounts that a user requests. The form on the page has several ListViews that may or may not be visible. On each list view, the list item has a radio button where the approver can set the approval to yes or no.

My problem is with the Feedback Panel. I'm setting the approval radio button to required if the corresponding ListView is visible. That works. If I don't select anything, the page doesn't do anything on submit as the form didn't validate. This is correct. But the Feedback Panel doesn't show anything either. It used to - under 1.5 I believe, I'm not quite sure when exactly it stopped. I can implement onError(), but there I can only give a generic error message like "Something didn't validate in the form". The session feedback messages are empty.

After combing through the user forum, I found that listView.setReuseItems(true) should solve the problem. I tried that, and miraculously my feedback messages all show. But now I have the problem that with the reuse my list view data is not behaving as it should. I have a lot of Ajax interaction on each line, and as the ListView is reusing its stuff, it doesn't work as intended anymore.

Long story short, is there any way to get my Feedback Panel working again without listView.setReuseItems(true)?

Thanks,
Natalie
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ListView and Feedback Panel

Martin Grigorov-4
Hi,


On Tue, Apr 16, 2013 at 5:38 PM, N. Metzger <[hidden email]> wrote:

> I'm running Wicket 6.3 and have an approval page where a user can approve
> certain accounts that a user requests. The form on the page has several
> ListViews that may or may not be visible. On each list view, the list item
> has a radio button where the approver can set the approval to yes or no.
>
> My problem is with the Feedback Panel. I'm setting the approval radio
> button
> to required if the corresponding ListView is visible. That works. If I
> don't
> select anything, the page doesn't do anything on submit as the form didn't
> validate. This is correct. But the Feedback Panel doesn't show anything
> either. It used to - under 1.5 I believe, I'm not quite sure when exactly
> it
> stopped. I can implement onError(), but there I can only give a generic
> error message like "Something didn't validate in the form". The session
> feedback messages are empty.
>
> After combing through the user forum, I found that
> listView.setReuseItems(true) should solve the problem. I tried that, and
> miraculously my feedback messages all show. But now I have the problem that
> with the reuse my list view data is not behaving as it should. I have a lot
> of Ajax interaction on each line, and as the ListView is reusing its stuff,
> it doesn't work as intended anymore.
>
> Long story short, is there any way to get my Feedback Panel working again
> without listView.setReuseItems(true)?
>

Yes. You may use getPage().error(...) instead of
somethingInsideTheListView.error(....)
The problem is that the component inside ListView is replaced with a new
one if reuseItems == false and since Wicket 6.0 the feedback messages are
kept in component's metadata.


>
> Thanks,
> Natalie
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Problem-with-ListView-and-Feedback-Panel-tp4658029.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ListView and Feedback Panel

N. Metzger
Ok, I understand the philosophy behind it.

My problem is that I'm not generating error messages myself, but rely on Wicket for 2 things. In the ListView my radio button has setRequired(true) and my DateTextField has a PatternDateConverter, so how do I pull the validation error messages out for those and put them on the page?

Natalie
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ListView and Feedback Panel

Sven Meier
Hi Natalie,

you should try to make your components ready to be used in ListViews.
If you're chaining your models correctly, there's no why
ListView#setReuseItems(true) should be a problem.

Regards
Sven

On 04/16/2013 05:23 PM, N. Metzger wrote:

> Ok, I understand the philosophy behind it.
>
> My problem is that I'm not generating error messages myself, but rely on
> Wicket for 2 things. In the ListView my radio button has setRequired(true)
> and my DateTextField has a PatternDateConverter, so how do I pull the
> validation error messages out for those and put them on the page?
>
> Natalie
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-ListView-and-Feedback-Panel-tp4658029p4658032.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


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

Reply | Threaded
Open this post in threaded view
|

Re: Problem with ListView and Feedback Panel

N. Metzger
I probably wasn't precise enough. The components in the ListView are still working fine. But I have an AjaxCheckBox outside of the ListView that gives me "Select all" functionality. I added the web markup container that wraps the listview to the ajax request target, but it doesn't update anymore after I reuse listview items.

Natalie
Reply | Threaded
Open this post in threaded view
|

Re: Problem with ListView and Feedback Panel

N. Metzger
In the end I think I have to use some other repeater to make that work, thanks for the help, though!