Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DropDownPage extends WebPage {
- private String morning;
- public DropDownPage() {
- Form<?> form = new Form<Void>("form");
- add(form);
- form.add(initDropDownChoice());
- form.add(new Label("selected", new PropertyModel<String>(this, "morning")));
- form.add(new Button("submit"));
- }
- private DropDownChoice<?> initDropDownChoice(){
- List<String> selectList = Arrays.asList("パン", "御飯", "抜き");
- DropDownChoice<?> ddc = new DropDownChoice<String>("dropDownChoice",
- new PropertyModel<String>(this, "morning"),
- selectList);
- return ddc;
- }
- }
Add Comment
Please, Sign In to add comment