Examples of addIfExists()


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()

        List<String> fieldErrorFieldNames = (List<String>) params.get("errorFieldNames");

        if (fieldErrorFieldNames != null && !fieldErrorFieldNames.isEmpty()) {
            //wrapping ul
            Attributes attrs = new Attributes();
            attrs.addIfExists("style", params.get("cssStyle"))
                    .add("class", params.containsKey("cssClass") ? (String) params.get("cssClass") : "errorMessage");
            start("ul", attrs);

            //iterate over field error names
            for (String fieldErrorFieldName : fieldErrorFieldNames) {
View Full Code Here

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

            end("ul");
        } else if (errors != null && !errors.isEmpty()) {
            //wrapping ul
            Attributes attrs = new Attributes();
            attrs.addIfExists("style", params.get("cssStyle"))
                    .add("class", params.containsKey("cssClass") ? (String) params.get("cssClass") : "errorMessage");
            start("ul", attrs);

            for (Map.Entry<String, List<String>> errorEntry : errors.entrySet()) {
                for (String fieldError : errorEntry.getValue()) {
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()

        end("li");
    }

    private void startUL(Map<String, Object> params) throws IOException {
        Attributes attrs = new Attributes();
        attrs.addIfExists("style", params.get("cssStyle"))
                .add("class", params.containsKey("cssClass") ? (String) params.get("cssClass") : "errorMessage");
        start("ul", attrs);
    }
}
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()) {
                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
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.