|
49 | 49 | </demo:PrettyPre> |
50 | 50 | </m:MaterialRow> |
51 | 51 |
|
| 52 | + <m:MaterialRow addStyleNames="code"> |
| 53 | + <m:MaterialTitle title="Using MaterialListValueBox" description="You can easily set the generic param with your desired object into the MaterialListValueBox." /> |
| 54 | + <m:MaterialListValueBox ui:field="lstValueBox" placeholder="Choose your hero" grid="s12"/> |
| 55 | + <demo:PrettyPre addStyleNames="lang-xml"> |
| 56 | +  // UiBinder<br/> |
| 57 | + <m:MaterialListValueBox ui:field="lstIntegerListBox" placeholder="Choose your hero" grid="s12"/> |
| 58 | + </demo:PrettyPre> |
| 59 | + <demo:PrettyPre addStyleNames="lang-java"> |
| 60 | +  // Java <br/> |
| 61 | + @UiField <br/> |
| 62 | + MaterialListValueBox<Hero> lstIntegerListBox; <br/><br/> |
| 63 | + |
| 64 | + for (Hero hero : DataHelper.getAllHeroes()) { <br/> |
| 65 | +  lstIntegerListBox.addItem(hero, hero.getName()); <br/> |
| 66 | + } <br/><br/> |
| 67 | + |
| 68 | + lstIntegerListBox.addValueChangeHandler(valueChangeEvent -> { <br/> |
| 69 | +  MaterialToast.fireToast("VALUE: " + valueChangeEvent.getValue().getName()); <br/> |
| 70 | + }); |
| 71 | + </demo:PrettyPre> |
| 72 | + </m:MaterialRow> |
| 73 | + |
52 | 74 | <m:MaterialRow addStyleNames="code"> |
53 | 75 | <m:MaterialTitle title="Add Option" description="You can easily add an item by calling addItem(Item)"/> |
54 | 76 | <m:MaterialListBox placeholder="ListBox" grid="s12" ui:field="lstAddOptions"> |
|
162 | 184 | </demo:PrettyPre> |
163 | 185 | </m:MaterialRow> |
164 | 186 |
|
| 187 | + |
| 188 | + <m:MaterialRow addStyleNames="code"> |
| 189 | + <m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" /> |
| 190 | + <m:MaterialTitle title="Empty Placeholder" /> |
| 191 | + <m:MaterialListValueBox ui:field="lstEmptyPlacehoder" emptyPlaceHolder="Select your Hero" grid="s12"/> |
| 192 | + <demo:PrettyPre addStyleNames="lang-xml"> |
| 193 | +  <m:MaterialListValueBox ui:field="lstEmptyPlacehoder" emptyPlaceHolder="Select your Hero"/> |
| 194 | + </demo:PrettyPre> |
| 195 | + </m:MaterialRow> |
| 196 | + |
| 197 | + <m:MaterialRow addStyleNames="code"> |
| 198 | + <m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" /> |
| 199 | + <m:MaterialTitle title="Focus and Blur Handlers" /> |
| 200 | + <m:MaterialListValueBox ui:field="lstFocusAndBlur" placeholder="Select your Hero" grid="s12"/> |
| 201 | + <demo:PrettyPre addStyleNames="lang-java"> |
| 202 | +  lstOptions.addFocusHandler(focusEvent -> { <br/> |
| 203 | +  MaterialToast.fireToast("FOCUSED");<br/> |
| 204 | + });<br/><br/> |
| 205 | + |
| 206 | + lstOptions.addBlurHandler(blurEvent -> {<br/> |
| 207 | +  MaterialToast.fireToast("BLURRED");<br/> |
| 208 | + }); |
| 209 | + </demo:PrettyPre> |
| 210 | + </m:MaterialRow> |
| 211 | + |
165 | 212 | <m:MaterialRow addStyleNames="code"> |
166 | 213 | <m:MaterialBadge text="FEATURE UPDATE" textColor="AMBER" shadow="1" layoutPosition="RELATIVE" float="RIGHT" backgroundColor="AMBER_LIGHTEN_5" /> |
167 | 214 | <m:MaterialTitle title="ListBox : Lazyload"/> |
|
0 commit comments