View Poll Results: Change the method setValue(boolean) to setValue(String) and add the method setChecked
- Voters
- 10. You may not vote on this poll
-
Yes
10 100.00% -
No
0 0%
Threaded View
-
7 Jan 2009 5:07 AM #1
Radio.setValueAux(String value)
Radio.setValueAux(String value)
If you need set the other value to your com.extjs.gxt.ui.client.widget.form.Radio that isn't the boxLabel.
MyRadio.java
ExampleCode:import com.extjs.gxt.ui.client.widget.form.Radio; public class MyRadio extends Radio { private String valueAux; public SfRadio() { } /* * (non-Javadoc) * @see com.extjs.gxt.ui.client.widget.BoxComponent#afterRender() */ @Override protected void afterRender() { setNewValue(); } /** * Real value of radio. * * @return value of radio. * @since 1.0 */ public String getValueAux() { return valueAux; } private void setNewValue() { if (valueAux != null) { getInputEl().dom.setAttribute("value", valueAux); } } /** * Set the new value to radio. * * @param valueAux new value. * @since 1.0 */ public void setValueAux(String valueAux) { this.valueAux = valueAux; } }
HistoryCode:public void onModuleLoad() { FormPanel form = new FormPanel(); final SfRadio radio = new SfRadio(); radio.setName("radio"); radio.setBoxLabel("Red"); radio.setValue(true); radio.setValueAux("1"); SfRadio radio2 = new SfRadio(); radio2.setName("radio"); radio2.setBoxLabel("Blue"); radio2.setValueAux("2"); RadioGroup radioGroup = new RadioGroup("test"); radioGroup.setFieldLabel("Favorite Color"); radioGroup.add(radio); radioGroup.add(radio2); form.add(radioGroup); RootPanel.get().add(form); }
07/01/09 - Remove the Listener and create an example



Reply With Quote