public Map<Object, SelectionModel.Option> getOptions() { return selectionModel.getOptions(selectionModelIndex); }
public Map<Object, SelectionModel.Option> getOptions() { return selectionModel.getOptions(selectionModelIndex); }
public Map<Object, SelectionModel.Option> getOptions() { return selectionModel.getOptions(selectionModelIndex); }
public Map<Object, SelectionModel.Option> getOptions() { return selectionModel.getOptions(selectionModelIndex); }
public void valueToXhtmlEditRadio(XhtmlBuffer xb) { Object value = selectionModel.getValue(selectionModelIndex); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); int counter = 0; if (!required) { String radioId = id + "_" + counter; boolean checked = (value == null); writeRadioWithLabel(xb, radioId, getText("elements.field.select.none"), "", checked); counter++; } for (Map.Entry<Object,SelectionModel.Option> option : options.entrySet()) { if(!option.getValue().active) { continue; } Object optionValue = option.getKey(); String optionStringValue = (String) OgnlUtils.convertValue(optionValue, String.class); String optionLabel = option.getValue().label; String radioId = id + "_" + counter; boolean checked = optionValue.equals(value); writeRadioWithLabel(xb, radioId, optionLabel, optionStringValue, checked); counter++; } // TODO: gestire radio in cascata }
public void valueToXhtmlEditRadio(XhtmlBuffer xb) { Object value = selectionModel.getValue(selectionModelIndex); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); int counter = 0; if (!required) { String radioId = id + "_" + counter; boolean checked = (value == null); writeRadioWithLabel(xb, radioId, getText("elements.field.select.none"), "", checked); counter++; } for (Map.Entry<Object,SelectionModel.Option> option : options.entrySet()) { if(!option.getValue().active) { continue; } Object optionValue = option.getKey(); String optionStringValue = (String) OgnlUtils.convertValue(optionValue, String.class); String optionLabel = option.getValue().label; String radioId = id + "_" + counter; boolean checked = optionValue.equals(value); writeRadioWithLabel(xb, radioId, optionLabel, optionStringValue, checked); counter++; } // TODO: gestire radio in cascata }
value = null; Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); boolean found = false; for(SelectionModel.Option option : options.values()) {
public void valueToXhtmlEditDropDown(XhtmlBuffer xb) { Object value = selectionModel.getValue(selectionModelIndex); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex);
public void valueToXhtmlEditDropDown(XhtmlBuffer xb) { Object value = selectionModel.getValue(selectionModelIndex); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex);
Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); boolean found = false; for(SelectionModel.Option option : options.values()) {
private void valueToXhtmlCheckbox(XhtmlBuffer xb) { xb.writeLabel(StringUtils.capitalize(label), id, ATTR_NAME_HTML_CLASS); Object[] values = getValues(); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); int counter=0; for (Map.Entry<Object,SelectionModel.Option> option : options.entrySet()) { if(!option.getValue().active) { continue; } xb.openElement("div"); xb.addAttribute("class", FORM_CONTROL_CSS_CLASS + " checkbox"); Object optionValue = option.getKey(); String optionStringValue = OgnlUtils.convertValueToString(optionValue); String optionLabel = option.getValue().label; boolean checked = ArrayUtils.contains(values, optionValue); String checkboxId = id + "_" + counter; xb.writeInputCheckbox(checkboxId, inputName, optionStringValue, checked); xb.openElement("label"); xb.addAttribute("for", checkboxId); xb.write(optionLabel); xb.closeElement("label"); xb.closeElement("div"); counter++; } }
private void valueToXhtmlCheckbox(XhtmlBuffer xb) { xb.writeLabel(StringUtils.capitalize(label), id, ATTR_NAME_HTML_CLASS); Object[] values = getValues(); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); int counter=0; for (Map.Entry<Object,SelectionModel.Option> option : options.entrySet()) { if(!option.getValue().active) { continue; } xb.openElement("div"); xb.addAttribute("class", FORM_CONTROL_CSS_CLASS + " checkbox"); Object optionValue = option.getKey(); String optionStringValue = OgnlUtils.convertValueToString(optionValue); String optionLabel = option.getValue().label; boolean checked = ArrayUtils.contains(values, optionValue); String checkboxId = id + "_" + counter; xb.writeInputCheckbox(checkboxId, inputName, optionStringValue, checked); xb.openElement("label"); xb.addAttribute("for", checkboxId); xb.write(optionLabel); xb.closeElement("label"); xb.closeElement("div"); counter++; } }
private void valueToXhtmlMultipleSelection(XhtmlBuffer xb) { xb.writeLabel(StringUtils.capitalize(label), id, ATTR_NAME_HTML_CLASS); xb.openElement("div"); xb.addAttribute("class", FORM_CONTROL_CSS_CLASS + " multiple-select"); Object[] values = getValues(); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); xb.openElement("select"); xb.addAttribute("id", id); xb.addAttribute("name", inputName); xb.addAttribute("multiple", "multiple"); xb.addAttribute("size", "5"); boolean checked; for (Map.Entry<Object,SelectionModel.Option> option : options.entrySet()) { if(!option.getValue().active) { continue; } Object optionValue = option.getKey(); String optionStringValue = OgnlUtils.convertValueToString(optionValue); String optionLabel = option.getValue().label; checked = ArrayUtils.contains(values, optionValue); xb.writeOption(optionStringValue, checked, optionLabel); } xb.closeElement("select"); xb.closeElement("div"); }
public void valueToXhtmlRadio(XhtmlBuffer xb) { Object[] values = getValues(); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex);
public void valueToXhtmlRadio(XhtmlBuffer xb) { Object[] values = getValues(); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex);
private void valueToXhtmlMultipleSelection(XhtmlBuffer xb) { xb.writeLabel(StringUtils.capitalize(label), id, ATTR_NAME_HTML_CLASS); xb.openElement("div"); xb.addAttribute("class", FORM_CONTROL_CSS_CLASS + " multiple-select"); Object[] values = getValues(); Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex); xb.openElement("select"); xb.addAttribute("id", id); xb.addAttribute("name", inputName); xb.addAttribute("multiple", "multiple"); xb.addAttribute("size", "5"); boolean checked; for (Map.Entry<Object,SelectionModel.Option> option : options.entrySet()) { if(!option.getValue().active) { continue; } Object optionValue = option.getKey(); String optionStringValue = OgnlUtils.convertValueToString(optionValue); String optionLabel = option.getValue().label; checked = ArrayUtils.contains(values, optionValue); xb.writeOption(optionStringValue, checked, optionLabel); } xb.closeElement("select"); xb.closeElement("div"); }
selectionModel.getOptions(selectionModelIndex); xb.openElement("select"); xb.addAttribute("id", id);
selectionModel.getOptions(selectionModelIndex); xb.openElement("select"); xb.addAttribute("id", id);
public String jsonSelectFieldOptions(boolean includeSelectPrompt) { Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex);
public String jsonSelectFieldOptions(boolean includeSelectPrompt) { Map<Object, SelectionModel.Option> options = selectionModel.getOptions(selectionModelIndex);