Tapestry: How to set HTML checkbox from java page -
i using plain html checkbox(not tapestry type). need set checkbox checked in java page. how do that?
here tml code fragment
<input type="checkbox" name="leaf" id="leaf" value="leaf"/>
any appreciated. thanks.
you need set checked property. i'd use <t:any>
component.
tml
<t:any element="input" type="literal:checkbox" name="literal:leaf" id="prop:clientid" value="prop:currentobject.value" checked="prop:checked" />
java
@property private sometype currentobject; public string getclientid() { return "mycheckbox_" + currentobject.getid(); } // if returns null, tapestry won't render attribute public string getchecked() { return currentobject.isselected() ? "checked" : null; }
Comments
Post a Comment