value.bind(slot);
value.setMaxLength(getMaxLength());
value.setSize(getSize());
HtmlMenu menu = new HtmlMenu();
menu.setName(slot.getKey().toString() + "_scale");
menu.createDefaultOption(RenderUtils.getResourceString("renderers.menu.default.title"));
for (GradeScale scale : GradeScale.values()) {
menu.createOption(RenderUtils.getEnumString(scale)).setValue(scale.getName());
}
if (grade != null && !grade.isEmpty()) {
value.setValue(grade.getValue());
menu.setValue(grade.getGradeScale().getName());
}
menu.setController(new HtmlController() {
@Override
public void execute(IViewState viewState) {
HtmlSimpleValueComponent component = (HtmlSimpleValueComponent) getControlledComponent();
value.setConverter(new GradeConverter(component.getValue()));