Package cn.com.elements.containstag.select

Examples of cn.com.elements.containstag.select.SelectElementTag


     * @param value
     * @throws AppException
     */
    protected void parserSelectElement(String parentId, Element e, String inputCss, ContainHTMLElementTag elementDiv,
        String value) throws AppException {
        SelectElementTag selectElement = new SelectElementTag();
        String selectedValue = value;
        selectElement.setCssClass(inputCss);
        selectElement.setReadonly(e.readonly());
        selectElement.setDisabled(e.disabled());
        selectElement.setId(StringUtil.joinString(_SPLIT_DO, parentId, e.id()));
        String[] values = e.source().value();
        if (values != null && values.length > 0) {
            int idx = 0;
            for (String d : values) {
                OptionElementTag optionElement = new OptionElementTag();
                optionElement.setDisplay(Element.LabelContent.getLabelContent(e.source().display()[idx++]));
                optionElement.setValue(d);
                // 设定option被选择
                if (d.equals(selectedValue)) {
                    optionElement.setSelected(true);
                }
                selectElement.addChildrenTag(optionElement);
            }
        }
        // 作为异常报错的提示标示
        selectElement.setTitle(Element.LabelContent.getLabelContent(StringUtil.isEmpty(e.label()) ? e.id().toUpperCase() : e.label()));
        selectElement.setRequired(e.required());
        selectElement.setTabindex(String.valueOf(tabIndex.next()));
        elementDiv.addChildrenTag(selectElement);
    }
View Full Code Here

TOP

Related Classes of cn.com.elements.containstag.select.SelectElementTag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.