Note that there are some explanatory texts on larger screens.

plurals
  1. POGWT - GXT - How to get Radio Button Value?
    primarykey
    data
    text
    <p>I am using GWT (Google Web Toolkit) 1.5.3 et GXT (ExtJS) 1.2 I just want to create a simple form with some radio buttons generated after a RPC call, to get some values</p> <p>Code:</p> <pre><code>final FormPanel simple = new FormPanel(); simple.setFrame(true); simple.setWidth(350); simple.setHeaderVisible(false); DateField date = new DateField(); date.setFieldLabel("Date"); simple.add(date); ListFluxServiceAsync service = (ListFluxServiceAsync) GWT.create(ListFluxService.class); ServiceDefTarget target = (ServiceDefTarget)service; String url = GWT.getModuleBaseURL() + "flux.rpc"; target.setServiceEntryPoint(url); final RadioGroup radioGroup = new RadioGroup("RadioGroup"); radioGroup.setFieldLabel("Flux"); radioGroup.setOrientation(Orientation.VERTICAL); service.getAllFlux(new AsyncCallback&lt;List&lt;FluxModelData&gt;&gt;(){ public void onFailure(Throwable caught) { GWT.log("flux.rpx::onFailure", caught); MessageBox.alert("what?", "onFailure :" + caught.getMessage(), null); } public void onSuccess(List&lt;FluxModelData&gt; result) { Iterator&lt;FluxModelData&gt; it = result.iterator(); while ( it.hasNext() ){ FluxModelData fmd = it.next(); Radio radio = new Radio(); radio.setName("flux"); radio.setValue(true); //radio.setRawValue("my very long value"); radio.setBoxLabel(fmd.getDescription()); radioGroup.add(radio); } simple.add(radioGroup); simple.layout(); //we need it to show the radio button } }); simple.setButtonAlign(HorizontalAlignment.CENTER); Button button = new Button("Récupérer"); button.addSelectionListener(new SelectionListener&lt;ButtonEvent&gt;(){ @Override public void componentSelected(ButtonEvent ce) { MessageBox.alert("what?", radioGroup.getValue().getRawValue() , null); }}); simple.addButton(button); RootPanel.get().add(simple); </code></pre> <p>My problem is I can't set/get radio button value. If I try the setRawValue("xxxxxxx"), I will get some null errors, while setting setValue(boolean) is working but I was expecting getting the radio value and not the label value.</p> <p>Any Idea?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload