Examples of addIfExists()


Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        super.end("select");
    }

    private void writeOption(String value, String text, boolean selected) throws IOException {
        Attributes attrs = new Attributes();
        attrs.addIfExists("value", value)
                .addIfTrue("selected", selected);

        start("option", attrs);
        characters(text);
        end("option");
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

    }

    private void writeOptionGroup(ListUIBean listUIBean, Object value) throws IOException {
        Map params = listUIBean.getParameters();
        Attributes attrs = new Attributes();
        attrs.addIfExists("label", params.get("label"))
                .addIfTrue("disabled", params.get("disabled"));
        start("optgroup", attrs);

        //options
        ValueStack stack = context.getStack();
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        super.end("select");
    }

    private void writeOption(String value, String text, boolean selected) throws IOException {
        Attributes attrs = new Attributes();
        attrs.addIfExists("value", value)
                .addIfTrue("selected", selected);

        start("option", attrs);
        characters(text);
        end("option");
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

    }

    private void writeOptionGroup(ListUIBean listUIBean, Object value) throws IOException {
        Map params = listUIBean.getParameters();
        Attributes attrs = new Attributes();
        attrs.addIfExists("label", params.get("label"))
                .addIfTrue("disabled", params.get("disabled"));
        start("optgroup", attrs);

        //options
        ValueStack stack = context.getStack();
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        if (errorsObj != null) {
            Iterator itt = MakeIterator.convert(errorsObj);
            if (itt.hasNext()) {
                Attributes attrs = new Attributes();
                attrs.addIfExists("style", params.get("cssStyle"))
                        .add("class", params.containsKey("cssClass") ? (String) params.get("cssClass") : getDefaultClass());
                start("ul", attrs);
                while (itt.hasNext()) {
                    String error = (String) itt.next();
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

                super.start("input", a);
                super.end("input");

                //Label section
                a = new Attributes();
                a.addIfExists("for", id)
                        .addIfExists("class", params.get("cssClass"))
                        .addIfExists("style", params.get("cssStyle"))
                        .addIfExists("title", params.get("title"));
                super.start("label", a);
                if (StringUtils.isNotEmpty(itemValueStr))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        Attributes attrs = new Attributes();

        String type = StringUtils.defaultString((String) params.get("type"), "input");

        if ("button".equals(type)) {
            attrs.addIfExists("name", params.get("name"))
                    .add("type", "submit")
                    .addIfExists("value", params.get("nameValue"))
                    .addIfTrue("disabled", params.get("disabled"))
                    .addIfExists("tabindex", params.get("tabindex"))
                    .addIfExists("id", params.get("id"))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

                    .addIfExists("class", params.get("cssClass"))
                    .addIfExists("style", params.get("cssStyle"));

            start("button", attrs);
        } else if ("image".equals(type)) {
            attrs.addIfExists("src", params.get("src"))
                    .add("type", "image")
                .addIfExists("alt", params.get("label"))
                .addIfExists("id", params.get("id"))
                    .addIfExists("class", params.get("cssClass"))
                .addIfExists("style", params.get("cssStyle"));
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

                .addIfExists("id", params.get("id"))
                    .addIfExists("class", params.get("cssClass"))
                .addIfExists("style", params.get("cssStyle"));
             start("input", attrs);
        } else {
            attrs.addIfExists("name", params.get("name"))
                    .add("type", "submit")
                    .addIfExists("value", params.get("nameValue"))
                    .addIfTrue("disabled", params.get("disabled"))
                    .addIfExists("tabindex", params.get("tabindex"))
                    .addIfExists("id", params.get("id"))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        public void generate() throws IOException {
            Map<String, Object> params = context.getParameters();

            Attributes attrs = new Attributes();

            attrs.addIfExists("name", params.get("name"))
                    .addIfExists("id", params.get("id"))
                    .addIfExists("class", params.get("cssClass"))
                    .addIfExists("style", params.get("cssStyle"))
                    .addIfExists("href", params.get("href"), false)
                    .addIfExists("title", params.get("title"))
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.