Hi,
Is it possible to display a CheckBox inside a template?
I am trying to display a list of options (checkbox with a label) as a ListView, but when I use the modified code in the ListView example, I get "(null handler)".
Here is the view definition:
Code:
view = new ListView<Util.EnumModel>() {
@Override
protected Util.EnumModel prepareData(Util.EnumModel model) {
CheckBox checkbox = new CheckBox();
String name = model.<String>get(Util.EnumModel.ENUM_DISPLAY_NAME_ID);
checkbox.setName(name);
checkbox.setBoxLabel(name);
checkbox.setWidth(100);
model.set("name", name);
model.set("checkbox", checkbox);
return model;
}
};
Here is the template definition:
Code:
private native String getRestaurantPhotoTemplate() /*-{
return ['<tpl for=".">',
'<div class="filter-wrap" id="{name}" style="border: 1px solid white">',
'<div class="filter">{checkbox}</div>',
'<span class="x-editable"></span></div>',
'</tpl>',
'<div class="x-clear"></div>'].join("");
}-*/;
PS
Is there something I can read on the templates besides the jdocs?