private void createRadioButton() { final RadioButton[] rb = new RadioButton[5]; RadioGroup rg = new RadioGroup(this); //create the RadioGroup rg.setOrientation(RadioGroup.HORIZONTAL);//or RadioGroup.VERTICAL for(int i=0; i<5; i++){ rb[i] = new RadioButton(this); rg.addView(rb[i]); //the RadioButtons are added to the radioGroup instead of the layout rb[i].setText("Test"); } ll.addView(rg);//you add the whole RadioGroup to the layout ll.addView(submit); submit.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { for(int i = 0; i < 5; i++) { rg.removeView(rb[i]);//now the RadioButtons are in the RadioGroup } ll.removeView(submit); Questions(); } }); }
RadioGroup ll = new RadioGroup(this); ll.setOrientation(LinearLayout.HORIZONTAL); rdbtn.setId((row * 2) + i); rdbtn.setText("Radio " + rdbtn.getId()); ll.addView(rdbtn);
@Override protected void onBeforeRender() { super.onBeforeRender(); CheckGroup<?> group = getGroup(); // make sure the form we need outputs its markup id. group.getForm().setOutputMarkupId(true); }
public AutoLabelMarker(FormComponent<?> component) { setFlag(VALID, component.isValid()); setFlag(REQUIRED, component.isRequired()); setFlag(ENABLED, component.isEnabledInHierarchy()); }
@Override public void onRequest() { getForm().onFormSubmitted(this); }
public boolean process() { // set redirect to true for a stateless form. setRedirect(true); return super.process(); }
/** * If the type is not set try to guess it if the model supports it. * * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { super.onBeforeRender(); resolveType(); }
public void reset() { super.validate(); editor.validate(); editor.clearInput(); }
/** * Update the model of all components on this form. * * @see #updateFormComponentModels() */ private void internalUpdateFormComponentModels() { FormComponent.visitComponentsPostOrder(this, new FormModelUpdateVisitor(this)); }
public AutoLabel(String id, Component fc) { super(id); component = fc; setMarkupId(getLabelIdFor(component)); setOutputMarkupId(true); }
@Override protected void onBeforeRender() { super.onBeforeRender(); CheckGroup<?> group = getGroup(); // make sure the form we need outputs its markup id. group.getForm().setOutputMarkupId(true); }
public AutoLabelMarker(FormComponent<?> component) { setFlag(VALID, component.isValid()); setFlag(REQUIRED, component.isRequired()); setFlag(ENABLED, component.isEnabledInHierarchy()); }
private void createRadioButton() { final RadioButton[] rb = new RadioButton[5]; RadioGroup rg = new RadioGroup(this); //create the RadioGroup rg.setOrientation(RadioGroup.HORIZONTAL);//or RadioGroup.VERTICAL for(int i=0; i<5; i++){ rb[i] = new RadioButton(this); rg.addView(rb[i]); //the RadioButtons are added to the radioGroup instead of the layout rb[i].setText("Test"); } ll.addView(rg);//you add the whole RadioGroup to the layout ll.addView(submit); submit.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { for(int i = 0; i < 5; i++) { rg.removeView(rb[i]);//now the RadioButtons are in the RadioGroup } ll.removeView(submit); Questions(); } }); }
@Override public void onRequest() { getForm().onFormSubmitted(this); }
/** * If the type is not set try to guess it if the model supports it. * * @see org.apache.wicket.Component#onBeforeRender() */ @Override protected void onBeforeRender() { super.onBeforeRender(); resolveType(); }
/** * Update the model of all components on this form. * * @see #updateFormComponentModels() */ private void internalUpdateFormComponentModels() { FormComponent.visitComponentsPostOrder(this, new FormModelUpdateVisitor(this)); }
public AutoLabel(String id, Component fc) { super(id); component = fc; setMarkupId(getLabelIdFor(component)); setOutputMarkupId(true); }
/** * If the type is not set try to guess it if the model supports it. * * @see org.apache.wicket.Component#onBeforeRender() */ protected void onBeforeRender() { super.onBeforeRender(); resolveType(); }