You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Kent Tong (JIRA)" <ta...@jakarta.apache.org> on 2005/09/10 04:24:30 UTC

[jira] Created: (TAPESTRY-636) field input value is not used if the field is not in error

field input value is not used if the field is not in error
----------------------------------------------------------

         Key: TAPESTRY-636
         URL: http://issues.apache.org/jira/browse/TAPESTRY-636
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
 Environment: Windows XP
    Reporter: Kent Tong


This bug is related to bug TAPESTRY-549. After calling clearErrors(), the errors are cleared and the input field values are still kept. When the TextField renders the next, it should display its existing input field value, but currently it will do so only when it is in error. The expected behavior is that it should display its existing input field value as long as there is a tracking for it.

The bug is in TranslatedFieldSupportImpl:

public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
{
    public String format(TranslatedField field, Object object)
    {
        IValidationDelegate delegate = field.getForm().getDelegate();

       //BUG: uses field input value only if it is in error
        return delegate.isInError() ? delegate.getFieldInputValue() : field.getTranslator().format(
                field,
                _threadLocale.getLocale(),
                object);
    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Fwd: [jira] Created: (TAPESTRY-636) field input value is not used if the field is not in error

Posted by Howard Lewis Ship <hl...@gmail.com>.
Ick; the machinations get more complicated.  

Perhaps what we need to do is, on rewind, discard the field tracking
for fields that pass validation.

We can then tweak the check from isInError() to hasInputValue() ...
which will only be true for fields that failed validation.

clearErrors() will keep the field trackings and field input values,
but set the error renderer to null.  I guess it should also remove any
unassociated errors.


---------- Forwarded message ----------
From: Kent Tong (JIRA) <ta...@jakarta.apache.org>
Date: Sep 9, 2005 10:24 PM
Subject: [jira] Created: (TAPESTRY-636) field input value is not used
if the field is not in error
To: tapestry-dev@jakarta.apache.org


field input value is not used if the field is not in error
----------------------------------------------------------

         Key: TAPESTRY-636
         URL: http://issues.apache.org/jira/browse/TAPESTRY-636
     Project: Tapestry
        Type: Bug
  Components: Framework
    Versions: 4.0
 Environment: Windows XP
    Reporter: Kent Tong


This bug is related to bug TAPESTRY-549. After calling clearErrors(),
the errors are cleared and the input field values are still kept. When
the TextField renders the next, it should display its existing input
field value, but currently it will do so only when it is in error. The
expected behavior is that it should display its existing input field
value as long as there is a tracking for it.

The bug is in TranslatedFieldSupportImpl:

public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
{
    public String format(TranslatedField field, Object object)
    {
        IValidationDelegate delegate = field.getForm().getDelegate();

       //BUG: uses field input value only if it is in error
        return delegate.isInError() ? delegate.getFieldInputValue() :
field.getTranslator().format(
                field,
                _threadLocale.getLocale(),
                object);
    }
}

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org



-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Re: [jira] Commented: (TAPESTRY-636) field input value is not used if the field is not in error

Posted by Howard Lewis Ship <hl...@gmail.com>.
Hm.  That comment was pretty incoherent! Does it make sense to you?

On 11/21/05, Howard M. Lewis Ship (JIRA)
<ta...@jakarta.apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/TAPESTRY-636?page=comments#action_12358195 ]
>
> Howard M. Lewis Ship commented on TAPESTRY-636:
> -----------------------------------------------
>
> Well, that field IS in error, you just don't want to see any decoration or error messages.  This maybe what is needed ... the ability to "turn off" error messages and decorations when re-rendering a submitted form, for this class of use classes (related to form refreshes).  And it would be nice if this was built into the default validation delegate (which, again, implies that we should split the validation delegate into a decorator part and a state-tracking part).
>
> > field input value is not used if the field is not in error
> > ----------------------------------------------------------
> >
> >          Key: TAPESTRY-636
> >          URL: http://issues.apache.org/jira/browse/TAPESTRY-636
> >      Project: Tapestry
> >         Type: Bug
> >   Components: Framework
> >     Versions: 4.0
> >  Environment: Windows XP
> >     Reporter: Kent Tong
> >     Assignee: Howard M. Lewis Ship
> >      Fix For: 4.0
>
> >
> > This bug is related to bug TAPESTRY-549. After calling clearErrors(), the errors are cleared and the input field values are still kept. When the TextField renders the next, it should display its existing input field value, but currently it will do so only when it is in error. The expected behavior is that it should display its existing input field value as long as there is a tracking for it.
> > The bug is in TranslatedFieldSupportImpl:
> > public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
> > {
> >     public String format(TranslatedField field, Object object)
> >     {
> >         IValidationDelegate delegate = field.getForm().getDelegate();
> >        //BUG: uses field input value only if it is in error
> >         return delegate.isInError() ? delegate.getFieldInputValue() : field.getTranslator().format(
> >                 field,
> >                 _threadLocale.getLocale(),
> >                 object);
> >     }
> > }
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-636) field input value is not used if the field is not in error

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-636?page=comments#action_12358195 ] 

Howard M. Lewis Ship commented on TAPESTRY-636:
-----------------------------------------------

Well, that field IS in error, you just don't want to see any decoration or error messages.  This maybe what is needed ... the ability to "turn off" error messages and decorations when re-rendering a submitted form, for this class of use classes (related to form refreshes).  And it would be nice if this was built into the default validation delegate (which, again, implies that we should split the validation delegate into a decorator part and a state-tracking part).

> field input value is not used if the field is not in error
> ----------------------------------------------------------
>
>          Key: TAPESTRY-636
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-636
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP
>     Reporter: Kent Tong
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> This bug is related to bug TAPESTRY-549. After calling clearErrors(), the errors are cleared and the input field values are still kept. When the TextField renders the next, it should display its existing input field value, but currently it will do so only when it is in error. The expected behavior is that it should display its existing input field value as long as there is a tracking for it.
> The bug is in TranslatedFieldSupportImpl:
> public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
> {
>     public String format(TranslatedField field, Object object)
>     {
>         IValidationDelegate delegate = field.getForm().getDelegate();
>        //BUG: uses field input value only if it is in error
>         return delegate.isInError() ? delegate.getFieldInputValue() : field.getTranslator().format(
>                 field,
>                 _threadLocale.getLocale(),
>                 object);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-636) field input value is not used if the field is not in error

Posted by "Kent Tong (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-636?page=comments#action_12358111 ] 

Kent Tong commented on TAPESTRY-636:
------------------------------------

Then how to handle this case: Suppose that there is a form that has contains input fields including one that should have say a credit card #. Clicking a checkbox will refresh the form to allow for some optional input fields. Suppose that a user has entered the initial part of the card # but it's incomplete yet, but notices that he needs the optional input fields. So he clicks that checkbox and the form is refreshed. The ideal response is that the partial card # entered is still displayed. But as the errors are cleared, the partial card # won't be displayed.

> field input value is not used if the field is not in error
> ----------------------------------------------------------
>
>          Key: TAPESTRY-636
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-636
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP
>     Reporter: Kent Tong
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> This bug is related to bug TAPESTRY-549. After calling clearErrors(), the errors are cleared and the input field values are still kept. When the TextField renders the next, it should display its existing input field value, but currently it will do so only when it is in error. The expected behavior is that it should display its existing input field value as long as there is a tracking for it.
> The bug is in TranslatedFieldSupportImpl:
> public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
> {
>     public String format(TranslatedField field, Object object)
>     {
>         IValidationDelegate delegate = field.getForm().getDelegate();
>        //BUG: uses field input value only if it is in error
>         return delegate.isInError() ? delegate.getFieldInputValue() : field.getTranslator().format(
>                 field,
>                 _threadLocale.getLocale(),
>                 object);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Resolved: (TAPESTRY-636) field input value is not used if the field is not in error

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-636?page=all ]
     
Howard M. Lewis Ship resolved TAPESTRY-636:
-------------------------------------------

    Fix Version: 4.0
     Resolution: Won't Fix
      Assign To: Howard M. Lewis Ship

I don't see this as a bug; if the field is not in error, then the value supplied by the user will have been applied, and will be reformatted (by the translator) and provided back.  Further, the form's listener method may have modified the value, and that, too, should be reflected back to the user.

> field input value is not used if the field is not in error
> ----------------------------------------------------------
>
>          Key: TAPESTRY-636
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-636
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP
>     Reporter: Kent Tong
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> This bug is related to bug TAPESTRY-549. After calling clearErrors(), the errors are cleared and the input field values are still kept. When the TextField renders the next, it should display its existing input field value, but currently it will do so only when it is in error. The expected behavior is that it should display its existing input field value as long as there is a tracking for it.
> The bug is in TranslatedFieldSupportImpl:
> public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
> {
>     public String format(TranslatedField field, Object object)
>     {
>         IValidationDelegate delegate = field.getForm().getDelegate();
>        //BUG: uses field input value only if it is in error
>         return delegate.isInError() ? delegate.getFieldInputValue() : field.getTranslator().format(
>                 field,
>                 _threadLocale.getLocale(),
>                 object);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


[jira] Commented: (TAPESTRY-636) field input value is not used if the field is not in error

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-636?page=comments#action_12358215 ] 

Jesse Kuhnert commented on TAPESTRY-636:
----------------------------------------

This is more or less what was recently (last 48 hours or so ;) ) being worked on in tacos. It of course relied on just bypassing client-side validation, while server-side errors were left to their own devices...

I like the state tracking being broken out of the validation portion idea very much. Implementation might be harder than thought though if people start doing double-duty on things like parsing/formatting incoming data for both validation and data capture. Maybe field tracking already handling exceptions thrown and data values separately (more or less) provides enough of an existing model to make this feasible without any new perf hits? 

> field input value is not used if the field is not in error
> ----------------------------------------------------------
>
>          Key: TAPESTRY-636
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-636
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Windows XP
>     Reporter: Kent Tong
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> This bug is related to bug TAPESTRY-549. After calling clearErrors(), the errors are cleared and the input field values are still kept. When the TextField renders the next, it should display its existing input field value, but currently it will do so only when it is in error. The expected behavior is that it should display its existing input field value as long as there is a tracking for it.
> The bug is in TranslatedFieldSupportImpl:
> public class TranslatedFieldSupportImpl implements TranslatedFieldSupport
> {
>     public String format(TranslatedField field, Object object)
>     {
>         IValidationDelegate delegate = field.getForm().getDelegate();
>        //BUG: uses field input value only if it is in error
>         return delegate.isInError() ? delegate.getFieldInputValue() : field.getTranslator().format(
>                 field,
>                 _threadLocale.getLocale(),
>                 object);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org