开发者

How can I make a Wicket form save radio button state?

开发者 https://www.devze.com 2023-02-19 08:28 出处:网络
I want to have a repeater like DataView or ListView. The first column of each row (named User ID) should be read from a List, and for each user ID, the program should dynamically create three radio bu

I want to have a repeater like DataView or ListView. The first column of each row (named User ID) should be read from a List, and for each user ID, the program should dynamically create three radio buttons like these:

How can I make a Wicket form save radio button state?

Requirements:

  1. The user must able to change selection of radio buttons.
  2. When the user clicks the submit button, radio values be displayed using the info("") method.

I've already done this by using this example, but when I cl开发者_StackOverflow社区ick the submit button, old selections are shown, and the form gets reset to those old selections.


This example code might be helpful.


ListView doesn't play very well with form components, but it may work if you call ListView.setReuseItems(true);.

0

精彩评论

暂无评论...
验证码 换一张
取 消