{
final String clientId = javaScriptSupport.allocateClientId(componentResources);
final String clientValue = encoder.toClient(model.getValue());
final Element checkbox = writer.element("input", "type", "checkbox", "id", clientId, "name", getControlName(), "value", clientValue);
if (getSelected().contains(model.getValue()))
{
checkbox.attribute("checked", "checked");
}
writer.end();
writer.element("label", "for", clientId);
writer.write(model.getLabel());