Examples of HtmlTag


Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

    }
   
    private void renderHiddenValue(HtmlWriter writer)
    {
        // Render Hidden input
        HtmlTag input = writer.startTag("input");
        input.addAttribute("type", "hidden");
        input.addAttribute("name", getName()+ "!");
        // Get Value
        String value;
        if (recordValue instanceof Date)
        {   // Special for Dates and timestamps
            String format = (column!=null && column.getDataType()==DataType.DATE) ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm:ss.S";
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            value = sdf.format(recordValue);
        }
        else
        {   // Let Record do the conversion
            value = StringUtils.valueOf(recordValue);
        }
        // Add Value Attribute
        if (value.length()>0)
            input.addAttribute("value", value);
        else
            writer.print("value=\"\"");
        input.endTag();
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

    }
   
    @Override
    public void renderInput(HtmlWriter writer, ControlInfo ci)
    {
        HtmlTag input = writer.startTag("input");
        input.addAttribute("type", "text");
        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        if (ci.getDisabled()==false)
        {   // Name of the field
            input.addAttribute("name", ci.getName());
            // Get Max Length
            int maxLength = getMaxInputLength(ci.getColumn());
            if (maxLength>0)
            {
                input.addAttribute("maxlength", maxLength);
                input.addAttribute("size", String.valueOf(Math.min(maxLength, ci.getHSize())));
            }  
        }
        else
        {   // Disabled text control
            input.addAttribute("disabled");
            // Get Max Length
            int maxLength = getMaxInputLength(ci.getColumn());
            if (maxLength>0)
            {
                input.addAttribute("size", String.valueOf(Math.min(maxLength, ci.getHSize())));
            }  
        }
        // Value
        input.addAttribute("value", formatValue(ci, ci.getDisabled()));
        // Event Attributes
        input.addAttribute("onclick",   ci.getOnclick());
        input.addAttribute("onchange",  ci.getOnchange());
        input.addAttribute("onfocus",   ci.getOnfocus());
        input.addAttribute("onblur",    ci.getOnblur());
        input.endTag();
        // Add Unit
        if (ci.getDisabled()==false)
        {  
            String unit = getUnitString(ci);
            if (unit != null)
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

        try
        { // No Value

            // Render value
            HtmlWriter htmlWriter = new HtmlWriter(writer);
            HtmlTag table = htmlWriter.startTag("table");
            table.addAttribute("id", this.id);
            table.addAttribute("class", this.cssClass);
            table.addAttribute("style", this.cssStyle);
            table.addAttribute("cellpadding", this.cellpadding);
            table.addAttribute("cellspacing", this.cellspacing);
            table.beginBody();

            renderHeader(htmlWriter);
            renderBody(htmlWriter);

            table.endTag();
            return false; // do not evaluate body again!

        } catch (Exception e)
        {
            log.error("error when rendering", e);
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

        }
    }

    private void renderHeader(HtmlWriter writer)
    {
        HtmlTag monthHeader = writer.startTag("tr");
        monthHeader.beginBody();

        HtmlTag thMonth = writer.startTag("th");
        thMonth.addAttribute("class", this.monthClass);
        thMonth.addAttribute("colspan", 8);
        thMonth.beginBody();
        String item = calendarInfo.getLinkText();
        String text = calendarInfo.getMonthText() + " " + calendarInfo.getYearText();
        if (selectMonthAction != null)
        {
            renderLink(writer, text, selectMonthAction, paramName, item);
            text = null;
        }
        thMonth.endTag(text);
        monthHeader.endTag();

        HtmlTag weekHeader = writer.startTag("tr");
        weekHeader.beginBody();

        HtmlTag kwHead = writer.startTag("th");
        kwHead.addAttribute("class", this.dayOfWeekClass);
        kwHead.beginBody();
        kwHead.endTag("KW");

        for (int i = 0; i < 7; i++)
        {
            HtmlTag thWeekDays = writer.startTag("th");
            thWeekDays.addAttribute("class", this.dayOfWeekClass);
            thWeekDays.beginBody();
            text = calendarInfo.getDayOfWeekText(i);
            if (selectWeekdayAction != null)
            {
                renderLink(writer, text, selectWeekdayAction, paramName, item);
                text = null;
            }
            thWeekDays.endTag(text);
        }
        weekHeader.endTag();
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

    private void renderBody(HtmlWriter writer)
    {
        // for each week in a month
        for (int i = 0; i < calendarInfo.getWeekCount(); i++)
        {
            HtmlTag weekRow = writer.startTag("tr");
            weekRow.beginBody();

            // for each day in a week
            renderKalendarWeek(calendarInfo.getWeek(i), writer);
            for (CalendarInfo.CalendarDayInfo day : calendarInfo.getWeek(i))
            {
                renderDay(day, writer);
            }
            weekRow.endTag();
        }
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

    }

    @Override
    public void renderInput(HtmlWriter writer, ControlInfo ci)
    {
        HtmlTag input = writer.startTag("input");
        input.addAttribute("type", "password");
        input.addAttribute("id",    ci.getId());
        input.addAttribute("class", ci.getCssClass());
        input.addAttribute("style", ci.getCssStyle());
        if (ci.getDisabled()==false)
        {   // Name of the field
            input.addAttribute("name", ci.getName());
            // Get Max Length
            int maxLength = (int)ci.getColumn().getSize();
            if (maxLength>0)
            {
                input.addAttribute("maxlength", maxLength);
                input.addAttribute("size", String.valueOf(Math.min(maxLength, ci.getHSize())));
            }  
        }
        else
        {   // Disabled text control
            input.addAttribute("disabled");
            // Get Max Length
            int maxLength = (int)ci.getColumn().getSize();
            if (maxLength>0)
            {
                input.addAttribute("size", String.valueOf(Math.min(maxLength, ci.getHSize())));
            }  
        }
        // Value
        input.addAttribute("value",     formatValue(ci));
        // Event Attributes
        input.addAttribute("onclick",   ci.getOnclick());
        input.addAttribute("onchange",  ci.getOnchange());
        input.addAttribute("onfocus",   ci.getOnfocus());
        input.addAttribute("onblur",    ci.getOnblur());
        input.endTag();
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

                break;
            }
        }
       
        // Render Tag
        HtmlTag weekCell = writer.startTag("td");
        weekCell.addAttribute("class", this.weekOfYearClass);
        weekCell.beginBody();

        if(StringUtils.isNotEmpty(bodyText) && StringUtils.isNotEmpty(selectWeekAction))
            renderLink(writer, bodyText, selectWeekAction, paramName, linkItem);
        else
            weekCell.endTag("");
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

            bodyText = "&nbsp;";
            cssClass = dateEmptyClass;
        }

        // Render Tag
        HtmlTag dateCell = writer.startTag("td");
        dateCell.addAttribute("class", cssClass);
        // dayCell.addAttribute("style", "text-align:center; width:25px; height:25px; border: 1px solid white;");
        dateCell.beginBody();
        if (linkItem != null)
        {
            renderLink(writer, bodyText, selectDateAction, paramName, linkItem);
            bodyText = null;
        }
        dateCell.endTag(bodyText);
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

        {
            paramMap = new LinkedHashMap<String, Object>();
            paramMap.put(param, value);
        }
        // Render Link now
        HtmlTag link = writer.startTag("a");
        link.addAttribute("href", getUrl(action, paramMap));
        link.beginBody(text);
        link.endTag();
    }
View Full Code Here

Examples of org.apache.empire.struts2.html.HtmlWriter.HtmlTag

    {
        if (vi instanceof ControlInfo)
        {   // Wrap read only in a div if it's a control
            ControlInfo ci = ((ControlInfo)vi);
            HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
            HtmlTag div = writer.startTag(dic.InputReadOnlyDataWrapperTag());
            div.addAttribute("id",    ci.getId());
            div.addAttribute("class", ci.getCssClass());
            div.addAttribute("style", ci.getCssStyle());
            div.beginBody();
            internalRenderText(writer, vi);
            div.endTag();
        }
        else
        {
            internalRenderText(writer, vi);
        }
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.