개발햄비

[wicket] radioGroup 例 본문

개발/wicket

[wicket] radioGroup 例

개발햄 2019. 3. 19. 20:03

Form form = new Form("form");

add(form);


IModel<Company> selected = new Model<Company>();

RadioGroup group = new RadioGroup("group", selected);

form.add(group);


group.setOutputMarkupId(true); 


// 選択したデータを更新する
group.add(new AjaxFormChoiceComponentUpdatingBehavior() { 
        @Override 
        protected void onUpdate(AjaxRequestTarget target) { 
                System.out.println("on change"); 
        } 
}); 


List<Company> companies = new ArrayList<Company>();


group.add(new ListView<Company>("choice", companies) {

protected void populateItem(ListItem<Company> it)

 {

it.add(new Radio("radio", it.getModel()));

it.add(new Label("label", it.getModelObject().getName()));

}

});

'개발 > wicket' 카테고리의 다른 글

[wicket] wicket button javascript 転送の例  (0) 2019.02.16
[wicket] wicket button 例  (0) 2019.02.16
[wicket]wicket ラジオ、radio使い方、例  (0) 2019.01.27