Package org.apache.tapestry

Examples of org.apache.tapestry.Field


    @SuppressWarnings("unchecked")
    @Test
    public void value_type_check_skipped_for_null_values() throws Exception
    {
        Field field = mockField();
        MessageFormatter formatter = mockMessageFormatter();
        Validator validator = mockValidator();

        train_isRequired(validator, true);
View Full Code Here


    private ComponentResources _resources;

    @BeginRender
    void begin(MarkupWriter writer)
    {
        final Field field = _field;

        final Element element = writer.element("label");

        _resources.renderInformalParameters(writer);

        // Uh oh! Referencing a private field (that happens to get instrumented up the wazoo) from
        // a inner class causes a java.lang.Verify error (Unable to pop operand off an empty stack).
        // Perhaps this is a Javassist error? Shouldn't the inner class be going through a synthetic
        // accessor method of some kind? Resolved by assigning to a local variable and referencing
        // that. Layers on layers, oh my!

        final ValidationDecorator decorator = _decorator;

        // Since we don't know if the field has rendered yet, we need to defer writing the for
        // attribute until we know the field has rendered (and set its clientId property). That's
        // exactly what Heartbeat is for.

        Runnable command = new Runnable()
        {
            public void run()
            {
                String fieldId = field.getClientId();

                element.forceAttributes("for", fieldId);

                decorator.insideLabel(field, element);
            }
View Full Code Here

        expect(validator.getMessageKey()).andReturn(messageKey).atLeastOnce();
    }

    protected final Field newFieldWithLabel(String label)
    {
        Field field = newField();

        train_getLabel(field, label);

        return field;
    }
View Full Code Here

    @Test
    public void label_error_no_existing_class_attribute()
    {
        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), null);
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);
View Full Code Here

    @Test
    public void label_error_with_existing_class_attribute()
    {
        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), null);
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);
View Full Code Here

    @Test
    public void field_error()
    {
        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), null);
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);
        train_peekRequired(env, MarkupWriter.class, writer);
View Full Code Here

    @Test
    public void field_ok()
    {
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, false);
View Full Code Here

    @Test
    public void label_when_field_not_in_error()
    {
        Environment env = newEnvironment();
        Field field = newField();
        ValidationTracker tracker = newValidationTracker();

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, false);
View Full Code Here

{
    @SuppressWarnings("unchecked")
    @Test
    public void null_value_skipped() throws Exception
    {
        Field field = newField();
        MessageFormatter formatter = newMessageFormatter();
        Validator validator = newValidator();

        train_invokeIfBlank(validator, false);
View Full Code Here

    @SuppressWarnings("unchecked")
    @Test
    public void blank_value_skipped() throws Exception
    {
        Field field = newField();
        MessageFormatter formatter = newMessageFormatter();
        Validator validator = newValidator();

        train_invokeIfBlank(validator, false);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.Field

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.