/** * Factory method for create the new {@link RadioGroup}. This method is invoked in the * constructor from the derived classes and can be overridden so users can provide their own * version of a new {@link RadioGroup}. * * @param id * the id * @param model * the model * @return the new {@link RadioGroup} */ protected RadioGroup<T> newRadioGroup(final String id, final IModel<T> model) { final RadioGroup<T> group = ComponentFactory.newRadioGroup(id, model); group.add(new AjaxFormChoiceComponentUpdatingBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate(final AjaxRequestTarget target) { RadioGroupPanel.this.onUpdate(target); } }); return group; }
final RadioGroup outputType = new RadioGroup("outputType"); Radio pdf = new Radio(); Radio docx = new Radio(); Radio rtf = new Radio(); Radio ods = new Radio(); outputType.add(pdf); outputType.add(docx); outputType.add(rtf); outputType.add(ods); //this goes panel.add(pdf); panel.add(docx); panel.add(rtf); panel.add(ods); //instead of this panel.add(outputType);
/** * Factory method for create the new {@link RadioGroup}. This method is invoked in the * constructor from the derived classes and can be overridden so users can provide their own * version of a new {@link RadioGroup}. * * @param id * the id * @param model * the model * @return the new {@link RadioGroup} */ protected RadioGroup<T> newRadioGroup(final String id, final IModel<T> model) { final RadioGroup<T> group = ComponentFactory.newRadioGroup(id, model); group.add(new AjaxFormChoiceComponentUpdatingBehavior() { private static final long serialVersionUID = 1L; @Override protected void onUpdate(final AjaxRequestTarget target) { RadioGroupPanel.this.onUpdate(target); } }); return group; }
final RadioGroup rg = new RadioGroup("radiochoicegroup", model); rg.setRenderBodyOnly(false); rg.add(new ListView("radiochoices", choices) { @Override protected void populateItem(ListItem item) {
/** * Instantiates a new {@link AjaxRadioPanel}. * * @param id * the id * @param model * the model */ public AjaxRadioPanel(final String id, final IModel<RadioGroupModelBean<T>> model) { super(id, model); add(form = newForm("form")); form.add(radioGroup = newRadioGroup("radioGroup", new PropertyModel<T>(model.getObject(), "selected"))); radioGroup.add(newRadios(radioGroup, model)); }
/** * Instantiates a new {@link AjaxRadioPanel}. * * @param id * the id * @param model * the model */ public AjaxRadioPanel(final String id, final IModel<RadioGroupModelBean<T>> model) { super(id, model); add(form = newForm("form")); form.add(radioGroup = newRadioGroup("radioGroup", new PropertyModel<T>(model.getObject(), "selected"))); radioGroup.add(newRadios(radioGroup, model)); }
radioGroup.add(repeater = new RepeatingView("repeater")); setRenderBodyOnly(true);
final RadioGroup rg = new RadioGroup("radiochoicegroup", model); rg.setRenderBodyOnly(false); rg.add(new ListView("radiochoices", choices) { @Override protected void populateItem(ListItem item) {
rg.add(e.get(i)); e.remove(i); n--;
radioGroup.add(view);
group.setRenderBodyOnly(false); group.add(new ListView<T>("choices", choices) { private static final long serialVersionUID = 1L;
group.setRenderBodyOnly(false); group.add(new ListView<T>("choices", choices) { private static final long serialVersionUID = 1L;
radioGroup.add(view);
/** * Instantiates a new {@link RadioGroupPanel}. * * @param id * the id * @param model * the model */ public RadioGroupPanel(final String id, final IModel<RadioGroupModelBean<T>> model) { super(id, model); setOutputMarkupId(true); add(form = newForm("form", model)); form.add(group = newRadioGroup(newRadioName(), new PropertyModel<>(model, "selected"))); group.add(newRadioListView("choice", model)); }
selectRepetor.setOutputMarkupId(true); selectRepetor.setOutputMarkupPlaceholderTag(true); selectGroup.add(selectRepetor);
/** * Instantiates a new {@link RadioGroupPanel}. * * @param id * the id * @param model * the model */ public RadioGroupPanel(final String id, final IModel<RadioGroupModelBean<T>> model) { super(id, model); setOutputMarkupId(true); add(form = newForm("form", model)); form.add( group = newRadioGroup(newRadioName(), new PropertyModel<>(model, "selected") ) ); group.add(newRadioListView("choice", model)); }