Package org.apache.ecs.xhtml

Examples of org.apache.ecs.xhtml.input


        }

        // In order to isolate posted form elements into their own
        // map, prefix the variable name here. It will be stripped
        // when the handler plugin is executed.
        input field = new input( inputType,
                                 HANDLERPARAM_PREFIX + inputName,
                                 inputValue );

        String checked = (String)params.get("checked");
        field.setChecked( TextUtil.isPositive(checked)
                          || "checked".equalsIgnoreCase(checked) );
       
        String oldValue = (String)previousValues.get( inputName );
        if( oldValue != null )
        {
            field.setValue( oldValue );
        }

        if( size != null ) field.setSize( size );

        return field.toString(ctx.getEngine().getContentEncoding());
    }
View Full Code Here


        }

        // In order to isolate posted form elements into their own
        // map, prefix the variable name here. It will be stripped
        // when the handler plugin is executed.
        input field = new input( inputType,
                                 HANDLERPARAM_PREFIX + inputName,
                                 inputValue );

        String checked = params.get("checked");
        field.setChecked( TextUtil.isPositive(checked)
                          || "checked".equalsIgnoreCase(checked) );
       
        String oldValue = previousValues.get( inputName );
        if( oldValue != null )
        {
            field.setValue( oldValue );
        }

        if( size != null ) field.setSize( size );

        return field.toString(ctx.getEngine().getContentEncoding());
    }
View Full Code Here

        }

        // In order to isolate posted form elements into their own
        // map, prefix the variable name here. It will be stripped
        // when the handler plugin is executed.
        input field = new input( inputType,
                                 HANDLERPARAM_PREFIX + inputName,
                                 inputValue );

        String checked = (String)params.get("checked");
        field.setChecked( TextUtil.isPositive(checked)
                          || "checked".equalsIgnoreCase(checked) );
       
        String oldValue = (String)previousValues.get( inputName );
        if( oldValue != null )
        {
            field.setValue( oldValue );
        }

        if( size != null ) field.setSize( size );

        return field.toString(ctx.getEngine().getContentEncoding());
    }
View Full Code Here

    public void field_absent() throws Exception {
        GroupInstanceHelper group = tool.get("group1").getDefaultInstance();
        FieldHelper field = group.get("field1");

        // absent hidden field
        input hiddenTag = field.getAbsentHiddenField("defaultValue");
        assertThat(hiddenTag.toString(),
                   containsAll("<input", "name='_fm.g._0.f.absent'", "type='hidden'", "value='defaultValue'", "/>"));
    }
View Full Code Here

        // no attachment
        assertEquals(null, field.getAttachment());
        assertEquals("", field.getAttachmentEncoded());
        assertEquals(false, field.hasAttachment());

        input attachmentTag = field.getAttachmentHiddenField();
        assertThat(attachmentTag.toString(),
                   containsAll("<input", "name='_fm.g._0.f.attach'", "type='hidden'", "value=''", "/>"));

        // with attachment
        field.setAttachment("attachedObject");

        assertEquals("attachedObject", field.getAttachment());
        assertEquals("eNpb85aBtYSBL7GkJDE5IzXFPykrNbkEAFOhB7Y%3D", field.getAttachmentEncoded());
        assertEquals(true, field.hasAttachment());

        attachmentTag = field.getAttachmentHiddenField();
        assertThat(
                attachmentTag.toString(),
                containsAll("<input", "name='_fm.g._0.f.attach'", "type='hidden'",
                            "value='eNpb85aBtYSBL7GkJDE5IzXFPykrNbkEAFOhB7Y%3D'", "/>"));

        // clear attachment
        field.clearAttachment();
View Full Code Here

            return escapedValues;
        }

        /** 取得absent字段的HTML hidden field。 */
        public input getAbsentHiddenField(String value) {
            return new input("hidden", field.getAbsentKey(), defaultIfNull(value, EMPTY_STRING));
        }
View Full Code Here

            field.setAttachment(attachment);
        }

        /** 取得代表附件的HTML hidden field。 */
        public input getAttachmentHiddenField() {
            return new input("hidden", field.getAttachmentKey(), getAttachmentEncoded());
        }
View Full Code Here

            return escapedValues;
        }

        /** 取得absent字段的HTML hidden field。 */
        public input getAbsentHiddenField(String value) {
            return new input("hidden", field.getAbsentKey(), defaultIfNull(value, EMPTY_STRING));
        }
View Full Code Here

            field.setAttachment(attachment);
        }

        /** 取得代表附件的HTML hidden field。 */
        public input getAttachmentHiddenField() {
            return new input("hidden", field.getAttachmentKey(), getAttachmentEncoded());
        }
View Full Code Here

        /**
         * ȡ��absent�ֶε�HTML hidden field��
         */
        public input getAbsentHiddenField(String value) {
            return new input("hidden", field.getAbsentKey(), defaultIfNull(value, EMPTY_STRING));
        }
View Full Code Here

TOP

Related Classes of org.apache.ecs.xhtml.input

Copyright © 2018 www.massapicom. 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.