Package org.apache.empire.struts2.html.HtmlWriter

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag.addAttribute()


    public void renderInput(HtmlWriter writer, ControlInfo ci)
    {
        HtmlTag input = writer.startTag("textarea");
        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        input.addAttribute("name",  ci.getName());
        input.addAttribute("disabled", ci.getDisabled());
        input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
        input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
        // maxlength
View Full Code Here


        }
        else if (renderType==RenderType.LABEL)
        {
            // Render Label only
            HtmlTag label = writer.startTag("label");
            label.addAttribute("class", StringUtils.coalesce(this.labelClass, this.cssClass));
            label.addAttribute("style", StringUtils.coalesce(this.labelStyle, this.cssStyle));
            if (control.useLabelId())
                label.addAttribute("for", getId());
            label.beginBody(this.label);
            label.endTag();
View Full Code Here

    {
        HtmlTag input = writer.startTag("textarea");
        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        input.addAttribute("name",  ci.getName());
        input.addAttribute("disabled", ci.getDisabled());
        input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
        input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
        // maxlength
        if (ci.getDisabled()==false)
View Full Code Here

        HtmlTag input = writer.startTag("textarea");
        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        input.addAttribute("name",  ci.getName());
        input.addAttribute("disabled", ci.getDisabled());
        input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
        input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
        // maxlength
        if (ci.getDisabled()==false)
        {   // Get Max Length
View Full Code Here

        else if (renderType==RenderType.LABEL)
        {
            // Render Label only
            HtmlTag label = writer.startTag("label");
            label.addAttribute("class", StringUtils.coalesce(this.labelClass, this.cssClass));
            label.addAttribute("style", StringUtils.coalesce(this.labelStyle, this.cssStyle));
            if (control.useLabelId())
                label.addAttribute("for", getId());
            label.beginBody(this.label);
            label.endTag();
        }
View Full Code Here

        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        input.addAttribute("name",  ci.getName());
        input.addAttribute("disabled", ci.getDisabled());
        input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
        input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
        // maxlength
        if (ci.getDisabled()==false)
        {   // Get Max Length
            String checklength = getFormatOption(ci, "maxlength:");
View Full Code Here

        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        input.addAttribute("name",  ci.getName());
        input.addAttribute("disabled", ci.getDisabled());
        input.addAttribute("rows",  Math.max(ci.getVSize(), 2));
        input.addAttribute("cols",  Math.max(ci.getHSize(), 1));
        // maxlength
        if (ci.getDisabled()==false)
        {   // Get Max Length
            String checklength = getFormatOption(ci, "maxlength:");
            if (StringUtils.isNotEmpty(checklength))
View Full Code Here

            // Render Label only
            HtmlTag label = writer.startTag("label");
            label.addAttribute("class", StringUtils.coalesce(this.labelClass, this.cssClass));
            label.addAttribute("style", StringUtils.coalesce(this.labelStyle, this.cssStyle));
            if (control.useLabelId())
                label.addAttribute("for", getId());
            label.beginBody(this.label);
            label.endTag();
        }
        else if (renderType==RenderType.CONTROL)
        {   // Render Input
View Full Code Here

            String checklength = getFormatOption(ci, "maxlength:");
            if (StringUtils.isNotEmpty(checklength))
            {   // Do lengthcheck via onKeyPress and onKeyUp Events
                int maxLength = (int)ci.getColumn().getSize();
                checklength = StringUtils.replace(checklength, "{0}", String.valueOf(maxLength));
                input.addAttribute("onkeypress", checklength);
                input.addAttribute("onkeyup",    checklength);
            }  
        }
        // Event Attributes
        input.addAttribute("onclick",   ci.getOnclick());
View Full Code Here

        {   // Check wether to render all
            boolean renderWrapper =(renderType==RenderType.ALL);
           
            // the wrapper (only if renderLabel && renderControl are both true)
            HtmlTag wrapper = writer.startTag((renderWrapper ? dic.InputWrapperTag() : null));
            wrapper.addAttribute("class", dic.InputWrapperClass());
            wrapper.beginBody(true);

            if (renderType!=RenderType.INPUTCONTROL)
            {
                HtmlTag wrapLabel = writer.startTag(dic.InputLabelTag());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.