Examples of addIfExists()


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

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

        Map<String, Object> params = context.getParameters();
        Attributes attrs = new Attributes();

        Boolean showPassword = (Boolean) params.get("showPassword");
        if (showPassword != null && showPassword)
           attrs.addIfExists("value",  params.get("nameValue"));

        attrs.addDefaultToEmpty("name", params.get("name"))
                .add("type", "password")
                .addIfExists("size", params.get("size"))
                .addIfExists("maxlength", params.get("maxlength"))
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"));

        if (!isButton)
            attrs.addIfExists("title", params.get("title"));

        super.start("input", attrs);
        if (isButton) {
            String label = (String) params.get("label");
            if (StringUtils.isNotEmpty(label))
View Full Code Here

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

        if (errorsObj != null) {
            Iterator itt = MakeIterator.convert(errorsObj);
            if (itt.hasNext()) {
                boolean escape = BooleanUtils.toBooleanDefaultIfNull((Boolean) params.get("escape"), false);
                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()

public class DivHandler extends AbstractTagHandler implements TagGenerator {
    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("title", params.get("title"));
        super.start("div", attrs);
View Full Code Here

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

public class FormHandler extends AbstractTagHandler implements TagGenerator {
    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("onsubmit", params.get("onsubmit"))
                .addIfExists("onreset", params.get("onreset"))
                .addIfExists("action", params.get("action"))
                .addIfExists("target", params.get("target"))
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
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.