You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ben Sommerville (JIRA)" <de...@tapestry.apache.org> on 2007/04/18 07:03:15 UTC

[jira] Created: (TAPESTRY-1417) CSS classes on text input fields are discarded when field is in error

CSS classes on text input fields are discarded when field is in error
---------------------------------------------------------------------

                 Key: TAPESTRY-1417
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1417
             Project: Tapestry
          Issue Type: Bug
          Components: tapestry-core
            Reporter: Ben Sommerville
            Priority: Minor
             Fix For: 5.0.4


The TextField, TextArea and PasswordField components (all children of AbstractTextField) accept a "class" attribute as an informal parameter.  This is rendered correctly when the component is rendered normally.

However when the field has a validation error the ValidationDecorator will set class="t-error" before the informal attributes are added.  This prevents any user supplied classes being rendered.  

ValidationDecorator works correctly if the class attribute has already been written (it adds t-error it that case), the issue is that the AbstractTextField calls the decorator before the informal attributes are rendered.  

I'm not sure of the best way to ensure the decorator is called after the informal parameters.  The options I see are
a) remove the RenderInformals mixin from AbstractField & call renderInformalParameters explicitly
     -> downside is other children of AbstractField also have to explicitly deal with informal parameters
b) make class an explicit parameter 
     -> downside is that it has to be added to attributes explicitly somewhere
c) move the validation render & decorate to the BeforeRenderTemplate phase
     -> which feels a bit like a hack

I think option (a) is probably best.....
(happy to supply patch for whichever approach)





-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Closed: (TAPESTRY-1417) CSS classes on text input fields are discarded when field is in error

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1417.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0.6
         Assignee: Howard M. Lewis Ship

I've resolved this by directly invoking ComponentResources.renderInformalParameters() before allowing the ValidationDelegate to opoerate (via its renderInside() method).  This fixes the timing so that the delegate can modify the CSS class, merging its change with any provided by an informal parameter.

> CSS classes on text input fields are discarded when field is in error
> ---------------------------------------------------------------------
>
>                 Key: TAPESTRY-1417
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1417
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.4
>            Reporter: Ben Sommerville
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>             Fix For: 5.0.6
>
>
> The TextField, TextArea and PasswordField components (all children of AbstractTextField) accept a "class" attribute as an informal parameter.  This is rendered correctly when the component is rendered normally.
> However when the field has a validation error the ValidationDecorator will set class="t-error" before the informal attributes are added.  This prevents any user supplied classes being rendered.  
> ValidationDecorator works correctly if the class attribute has already been written (it adds t-error it that case), the issue is that the AbstractTextField calls the decorator before the informal attributes are rendered.  
> I'm not sure of the best way to ensure the decorator is called after the informal parameters.  The options I see are
> a) remove the RenderInformals mixin from AbstractField & call renderInformalParameters explicitly
>      -> downside is other children of AbstractField also have to explicitly deal with informal parameters
> b) make class an explicit parameter 
>      -> downside is that it has to be added to attributes explicitly somewhere
> c) move the validation render & decorate to the BeforeRenderTemplate phase
>      -> which feels a bit like a hack
> I think option (a) is probably best.....
> (happy to supply patch for whichever approach)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1417) CSS classes on text input fields are discarded when field is in error

Posted by "Ben Sommerville (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Sommerville updated TAPESTRY-1417:
--------------------------------------

        Fix Version/s:     (was: 5.0.4)
    Affects Version/s: 5.0.4

> CSS classes on text input fields are discarded when field is in error
> ---------------------------------------------------------------------
>
>                 Key: TAPESTRY-1417
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1417
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.4
>            Reporter: Ben Sommerville
>            Priority: Minor
>
> The TextField, TextArea and PasswordField components (all children of AbstractTextField) accept a "class" attribute as an informal parameter.  This is rendered correctly when the component is rendered normally.
> However when the field has a validation error the ValidationDecorator will set class="t-error" before the informal attributes are added.  This prevents any user supplied classes being rendered.  
> ValidationDecorator works correctly if the class attribute has already been written (it adds t-error it that case), the issue is that the AbstractTextField calls the decorator before the informal attributes are rendered.  
> I'm not sure of the best way to ensure the decorator is called after the informal parameters.  The options I see are
> a) remove the RenderInformals mixin from AbstractField & call renderInformalParameters explicitly
>      -> downside is other children of AbstractField also have to explicitly deal with informal parameters
> b) make class an explicit parameter 
>      -> downside is that it has to be added to attributes explicitly somewhere
> c) move the validation render & decorate to the BeforeRenderTemplate phase
>      -> which feels a bit like a hack
> I think option (a) is probably best.....
> (happy to supply patch for whichever approach)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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