You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andy Chu <an...@gmail.com> on 2005/06/03 05:52:47 UTC

How to overwrite an old css class within the a ValidField ?

From the workbench example, We know that Tapestry is able to indicate a 
ValidField being Invalid by writing a CSS class, for example "field-error", 
with the "writeAttributes" method in the delegate class of a specified form. 
However, for some purpose, the ValidField initially has its own CSS class 
"normal". It may be rendered as following in normal situation:

<input ... class="normal"/>

When an error is detected, the delegate class will render the ValidField 
like:

<input .. class="normal" class="field-error"/>

Since the "normal" class is kept, the "field-error" takes no effect at all. 

Would you please tell me how to make this class take effect or remove the 
"normal" class.

Best wishes, Andy

-- 
我是天空裡的一片雲
偶爾投影在妳的波心

----偶然.徐志摩

Re: How to overwrite an old css class within the a ValidField ?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jun 2, 2005, at 11:52 PM, Andy Chu wrote:

> From the workbench example, We know that Tapestry is able to  
> indicate a
> ValidField being Invalid by writing a CSS class, for example "field- 
> error",
> with the "writeAttributes" method in the delegate class of a  
> specified form.
> However, for some purpose, the ValidField initially has its own CSS  
> class
> "normal". It may be rendered as following in normal situation:
>
> <input ... class="normal"/>
>
> When an error is detected, the delegate class will render the  
> ValidField
> like:
>
> <input .. class="normal" class="field-error"/>
>
> Since the "normal" class is kept, the "field-error" takes no effect  
> at all.
>
> Would you please tell me how to make this class take effect or  
> remove the
> "normal" class.

Your custom ValidationDelegate could be solely responsible for  
putting the class="normal" on fields not in error.  However, why have  
a class="normal" in the first place?  "Normal" elements can be styled  
by element name rather than having a CSS class on them.

     Erik


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