html - How to generate 'required' Attribute in GWT using UIBinder? -
expected html
<input class="sth" type="input" required/>
how generate using uibinder in gwt? using following , not generating required attribute
<g:textbox ui:field="username"/>
you cannot in uibinder standard textbox widget. if one-off situation, set in code. if use often, create own widget extending textbox , adding:
public void setrequired(boolean isrequired) { if (isrequired) { getelement().setattribute("required", "required"); } }
then can use in uibinder:
<w:mytextbox ui:field="username" required="true"/>
where w
links widgets folder.
Comments
Post a Comment