You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Cristian Peraferrer <co...@gmail.com> on 2009/04/27 11:50:30 UTC

[s2] errorStyleClass equivalent in Struts 2

Hi,

Is there a way in struts2 to point out that there was validation
errors in each input field, like putting an error style using
errorStyleClass (of struts1)?

struts1 example:

<html:password property="password" styleId="password"
errorStyleClass="frmError"/>

Thanks,
Cris.

-- 
GPG Key-ID: 0x564903FA - JID: corellian@swissjabber.ch

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


Re: [s2] errorStyleClass equivalent in Struts 2

Posted by Burton Rhodes <bu...@gmail.com>.
I meant 'cssErrorClass'

<s:textfield value="[value]" cssClass="Data" cssErrorClass="DataError"
cssStyle="width: 75px" />

On Mon, Apr 27, 2009 at 1:25 PM, Burton Rhodes <bu...@gmail.com> wrote:
> I use 'cssError'  property with the simple theme. Works on text
> fields, but still haven't been able to set css properly for the
> datetimepicker.
>
> On 4/27/09, Dave Newton <ne...@yahoo.com> wrote:
>> Cristian Peraferrer wrote:
>>> Is there a way in struts2 to point out that there was validation
>>> errors in each input field, like putting an error style using
>>> errorStyleClass (of struts1)?
>>>
>>> struts1 example:
>>>
>>> <html:password property="password" styleId="password"
>>> errorStyleClass="frmError"/>
>>
>> The xhtml theme does this by default. The style can be overridden by
>> including your own style sheet after the S2 head tag.
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> --
> Sent from my mobile device
>

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


Re: [s2] errorStyleClass equivalent in Struts 2

Posted by Burton Rhodes <bu...@gmail.com>.
I use 'cssError'  property with the simple theme. Works on text
fields, but still haven't been able to set css properly for the
datetimepicker.

On 4/27/09, Dave Newton <ne...@yahoo.com> wrote:
> Cristian Peraferrer wrote:
>> Is there a way in struts2 to point out that there was validation
>> errors in each input field, like putting an error style using
>> errorStyleClass (of struts1)?
>>
>> struts1 example:
>>
>> <html:password property="password" styleId="password"
>> errorStyleClass="frmError"/>
>
> The xhtml theme does this by default. The style can be overridden by
> including your own style sheet after the S2 head tag.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

-- 
Sent from my mobile device

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


Re: [s2] errorStyleClass equivalent in Struts 2

Posted by Dave Newton <ne...@yahoo.com>.
Cristian Peraferrer wrote:
> Is there a way in struts2 to point out that there was validation
> errors in each input field, like putting an error style using
> errorStyleClass (of struts1)?
> 
> struts1 example:
> 
> <html:password property="password" styleId="password"
> errorStyleClass="frmError"/>

The xhtml theme does this by default. The style can be overridden by 
including your own style sheet after the S2 head tag.

Dave


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


RE: How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Qunhuan Mei <qm...@qm18.wanadoo.co.uk>.
Silly me. After I added “.label {font-style:normal; }” to my css file, no
more italic present in the input form. Thank you again Dave.

 

-----Original Message-----
From: Qunhuan Mei [mailto:qm@qm18.wanadoo.co.uk] 
Sent: Monday, April 27, 2009 12:59 PM
To: 'Struts Users Mailing List'
Subject: RE: How to turn the struts textfield label from default italic to
normal (struts 2.1.6)

 

Dave, 

 

Thank you so much for your reply. It is a big relief when hope is shown for

solving the problem.

 

Could you confirm that by your stylesheet overriding approach do you mean to

write some css code for the below "tdLabel" (or "label", if applicable)

class?

 

Qunhuan

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

BTW, found a similar problem reporting link:

 

http://markmail.org/message/hl6mic6scgxaj5lz#query:struts%20cssStyle%20cssCl

ass%20green+page:1+mid:nm6ws7bq2wmbmnl3+state:results

 

 

 

 

 

-----Original Message-----

From: Dave Newton [mailto:newton.dave@yahoo.com] 

Sent: Monday, April 27, 2009 12:41 PM

To: Struts Users Mailing List

Subject: Re: How to turn the struts textfield label from default italic to

normal (struts 2.1.6)

 

 

 

 

 

While I haven't noticed this behavior, you can override the S2 

 

stylesheet by including your own stylesheet with overriding definitions 

 

after the S2 head tag.

 

 

 

Dave

 

 

 

Qunhuan Mei wrote:

 

> Hi,

 

> 

 

>  

 

> 

 

> I have a form which uses struts tag “textfield” and “text”. The default

font

 

> style for label generated for textfield appears to be italic while the one

 

> for text is normal. 

 

> 

 

>  

 

> 

 

> e.g. for 

 

> 

 

>  

 

> 

 

>        <s:textfield key="username" name="userAccount.username"

 

> required="true" />

 

> 

 

>  

 

> 

 

> The html code generated by struts are (seen by the browser’s view

source.):

 

> 

 

>  

 

> 

 

>    <tr>

 

> 

 

>          <td class="tdLabel"><label for="form_userAccount_username"

 

> class="label">Username<span class="required">*</span>:</label></td>

 

> 

 

>          <td><input type="text" name="userAccount.username" value=""

 

> id="form_userAccount_username"/></td>

 

> 

 

> </tr>

 

> 

 

> The label name “Username” is displayed in Italic (I suppose this is

 

> controlled by either the tdLabel or label class). 

 

> 

 

>  

 

> 

 

> I want to change Username’s font style to normal (non-italic) and so have

 

> tried cssStyle and cssClass for the textfield but it seems they are only

 

> applied to the input field element rather than the label one.

 

> 

 

>  

 

> 

 

> I have searched the internet but no luck in finding an answer.

 

> 

 

>  

 

> 

 

> It would be much appreciated if anyone could help.

 

> 

 

>  

 

> 

 

> Many thanks in advance,

 

> 

 

>  

 

> 

 

> Qunhuan

 

> 

 

>  

 

> 

 

> 

 

 

 

 

 

---------------------------------------------------------------------

 

To unsubscribe, e-mail: user-unsubscribe@struts.apache.org

 

For additional commands, e-mail: user-help@struts.apache.org

 

 

 


RE: How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Qunhuan Mei <qm...@qm18.wanadoo.co.uk>.
Dave, 

 

Thank you so much for your reply. It is a big relief when hope is shown for
solving the problem.

 

Could you confirm that by your stylesheet overriding approach do you mean to
write some css code for the below "tdLabel" (or "label", if applicable)
class?

 

Qunhuan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BTW, found a similar problem reporting link:

http://markmail.org/message/hl6mic6scgxaj5lz#query:struts%20cssStyle%20cssCl
ass%20green+page:1+mid:nm6ws7bq2wmbmnl3+state:results

 

 

-----Original Message-----
From: Dave Newton [mailto:newton.dave@yahoo.com] 
Sent: Monday, April 27, 2009 12:41 PM
To: Struts Users Mailing List
Subject: Re: How to turn the struts textfield label from default italic to
normal (struts 2.1.6)

 

 

While I haven't noticed this behavior, you can override the S2 

stylesheet by including your own stylesheet with overriding definitions 

after the S2 head tag.

 

Dave

 

Qunhuan Mei wrote:

> Hi,

> 

>  

> 

> I have a form which uses struts tag “textfield” and “text”. The default
font

> style for label generated for textfield appears to be italic while the one

> for text is normal. 

> 

>  

> 

> e.g. for 

> 

>  

> 

>        <s:textfield key="username" name="userAccount.username"

> required="true" />

> 

>  

> 

> The html code generated by struts are (seen by the browser’s view
source.):

> 

>  

> 

>    <tr>

> 

>          <td class="tdLabel"><label for="form_userAccount_username"

> class="label">Username<span class="required">*</span>:</label></td>

> 

>          <td><input type="text" name="userAccount.username" value=""

> id="form_userAccount_username"/></td>

> 

> </tr>

> 

> The label name “Username” is displayed in Italic (I suppose this is

> controlled by either the tdLabel or label class). 

> 

>  

> 

> I want to change Username’s font style to normal (non-italic) and so have

> tried cssStyle and cssClass for the textfield but it seems they are only

> applied to the input field element rather than the label one.

> 

>  

> 

> I have searched the internet but no luck in finding an answer.

> 

>  

> 

> It would be much appreciated if anyone could help.

> 

>  

> 

> Many thanks in advance,

> 

>  

> 

> Qunhuan

> 

>  

> 

> 

 

 

---------------------------------------------------------------------

To unsubscribe, e-mail: user-unsubscribe@struts.apache.org

For additional commands, e-mail: user-help@struts.apache.org

 


Re: How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Dave Newton <ne...@yahoo.com>.
While I haven't noticed this behavior, you can override the S2 
stylesheet by including your own stylesheet with overriding definitions 
after the S2 head tag.

Dave

Qunhuan Mei wrote:
> Hi,
> 
>  
> 
> I have a form which uses struts tag “textfield” and “text”. The default font
> style for label generated for textfield appears to be italic while the one
> for text is normal. 
> 
>  
> 
> e.g. for 
> 
>  
> 
>        <s:textfield key="username" name="userAccount.username"
> required="true" />
> 
>  
> 
> The html code generated by struts are (seen by the browser’s view source.):
> 
>  
> 
>    <tr>
> 
>          <td class="tdLabel"><label for="form_userAccount_username"
> class="label">Username<span class="required">*</span>:</label></td>
> 
>          <td><input type="text" name="userAccount.username" value=""
> id="form_userAccount_username"/></td>
> 
> </tr>
> 
> The label name “Username” is displayed in Italic (I suppose this is
> controlled by either the tdLabel or label class). 
> 
>  
> 
> I want to change Username’s font style to normal (non-italic) and so have
> tried cssStyle and cssClass for the textfield but it seems they are only
> applied to the input field element rather than the label one.
> 
>  
> 
> I have searched the internet but no luck in finding an answer.
> 
>  
> 
> It would be much appreciated if anyone could help.
> 
>  
> 
> Many thanks in advance,
> 
>  
> 
> Qunhuan
> 
>  
> 
> 


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


How to turn the struts textfield label from default italic to normal (struts 2.1.6)

Posted by Qunhuan Mei <qm...@qm18.wanadoo.co.uk>.
Hi,

 

I have a form which uses struts tag “textfield” and “text”. The default font
style for label generated for textfield appears to be italic while the one
for text is normal. 

 

e.g. for 

 

       <s:textfield key="username" name="userAccount.username"
required="true" />

 

The html code generated by struts are (seen by the browser’s view source.):

 

   <tr>

         <td class="tdLabel"><label for="form_userAccount_username"
class="label">Username<span class="required">*</span>:</label></td>

         <td><input type="text" name="userAccount.username" value=""
id="form_userAccount_username"/></td>

</tr>

The label name “Username” is displayed in Italic (I suppose this is
controlled by either the tdLabel or label class). 

 

I want to change Username’s font style to normal (non-italic) and so have
tried cssStyle and cssClass for the textfield but it seems they are only
applied to the input field element rather than the label one.

 

I have searched the internet but no luck in finding an answer.

 

It would be much appreciated if anyone could help.

 

Many thanks in advance,

 

Qunhuan