Skip to content

Commit 23dfe79

Browse files
committed
Fixed Radio Button setValues() demo & code blocks issue.
1 parent b0da235 commit 23dfe79

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/main/java/gwt/material/design/demo/client/application/components/forms/FormsView.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,21 @@ void onListBoxValueEvent(ClickEvent e) {
255255
lstSetValue.setValue("Option 3", true);
256256
}
257257

258+
@UiHandler("radioValue")
259+
void onRadioValue(ValueChangeEvent<Boolean> e) {
260+
MaterialToast.fireToast("Value : " + e.getValue());
261+
}
262+
263+
@UiHandler("btnRadioValue")
264+
void onClickRadioValue(ClickEvent e) {
265+
radioValue.setValue(true);
266+
}
267+
268+
@UiHandler("btnRadioValueEvent")
269+
void onClickRadioValueEvent(ClickEvent e) {
270+
radioValue.setValue(false, true);
271+
}
272+
258273
@UiHandler("switchEvent")
259274
void onSwitchEvent(ValueChangeEvent<Boolean> e) {
260275
MaterialToast.fireToast("Value " + e.getValue());

src/main/java/gwt/material/design/demo/client/application/components/forms/FormsView.ui.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,10 @@
330330
<m:MaterialTitle title="RadioButton : setValue(value, fireEvents)"/>
331331
<m:MaterialRadioButton ui:field="radioValue" name="color" text="Radio Button"/>
332332

333-
<m:MaterialButton text="Set Value" ui:field="btnRadioValue" marginRight="20" />
334-
<m:MaterialButton text="Set Value with Event" ui:field="btnRadioValueEvent" />
333+
<m:MaterialRow>
334+
<m:MaterialButton text="Set Value" ui:field="btnRadioValue" marginRight="20" />
335+
<m:MaterialButton text="Set Value with Event" ui:field="btnRadioValueEvent" />
336+
</m:MaterialRow>
335337
<demo:PrettyPre addStyleNames="lang-java">
336338
&emsp;// Set Value with firing the value change event <br/>
337339
range.setValue(true, true); <br/>

0 commit comments

Comments
 (0)