List of usage examples for org.apache.wicket.markup.html.form Radio getValue
public String getValue()
value
attribute of the input
tag. From source file:org.obiba.onyx.quartz.editor.category.CategoriesPanel.java
License:Open Source License
public CategoriesPanel(String id, final IModel<EditedQuestion> model, final IModel<Questionnaire> questionnaireModel, final IModel<LocaleProperties> localePropertiesModel, FeedbackPanel feedbackPanel, FeedbackWindow feedbackWindow) { super(id, model); final RadioGroup<Layout> radioLayout = new RadioGroup<Layout>("layout", new PropertyModel<Layout>(model, "layout")); radioLayout.setLabel(new ResourceModel("Layout")); add(radioLayout);/*from w w w . ja v a 2s . c o m*/ Radio<Layout> defaultColumnLayout = new Radio<Layout>("defaultColumnLayout", new Model<Layout>(null)); defaultColumnLayout.setLabel(new ResourceModel("Layout.default")); radioLayout.add(defaultColumnLayout); radioLayout.add(new SimpleFormComponentLabel("defaultColumnLayoutLabel", defaultColumnLayout)); Radio<Layout> singleColumnLayout = new Radio<Layout>("singleColumnLayout", new Model<Layout>(Layout.SINGLE_COLUMN)); singleColumnLayout.setLabel(new ResourceModel("Layout.single")); radioLayout.add(singleColumnLayout); radioLayout.add(new SimpleFormComponentLabel("singleColumnLayoutLabel", singleColumnLayout)); final Radio<Layout> gridLayout = new Radio<Layout>("gridLayout", new Model<Layout>(Layout.GRID)); gridLayout.setLabel(new ResourceModel("Layout.grid")); radioLayout.add(gridLayout); radioLayout.add(new SimpleFormComponentLabel("gridLayoutLabel", gridLayout)); TextField<Integer> nbRowsField = new TextField<Integer>("nbRows", new PropertyModel<Integer>(model, "nbRows")) { @Override public boolean isRequired() { return StringUtils.equals(radioLayout.getInput(), gridLayout.getValue()); } }; nbRowsField.setLabel(new ResourceModel("NbRows")); add(nbRowsField); add(new MultipleChoiceCategoryHeaderPanel("headerMultipleChoice", questionnaireModel, model)); add(new CategoryListPanel("categories", model, questionnaireModel, localePropertiesModel, feedbackPanel, feedbackWindow, this)); }