Guest User

Untitled

a guest
May 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class DropDownPage extends WebPage {
  2. private String morning;
  3.  
  4. public DropDownPage() {
  5. Form<?> form = new Form<Void>("form");
  6. add(form);
  7. form.add(initDropDownChoice());
  8. form.add(new Label("selected", new PropertyModel<String>(this, "morning")));
  9. form.add(new Button("submit"));
  10. }
  11.  
  12. private DropDownChoice<?> initDropDownChoice(){
  13. List<String> selectList = Arrays.asList("パン", "御飯", "抜き");
  14. DropDownChoice<?> ddc = new DropDownChoice<String>("dropDownChoice",
  15. new PropertyModel<String>(this, "morning"),
  16. selectList);
  17. return ddc;
  18. }
  19. }
Add Comment
Please, Sign In to add comment