Thanks for your support Mike. You were right, the syntax was correct, I
just had to put it on the right tag.

In the end, this is what I tested and worked...

<h:outputLabel id="outputLabelForInputText"
      for="inputText"
      value="Input follows"
      styleClass="#{testBean.error ? 'error' : 'body'}"/>

Thanks again.
Tom




                                                                           
             "Mike                                                         
             Kienenberger"                                                 
             <[EMAIL PROTECTED]                                          To 
             om>                       "MyFaces Discussion"                
                                       <[email protected]>          
             08/17/2006 12:50                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: has anyone used EL with a jsp   
             Please respond to         style tag?                          
                 "MyFaces                                                  
                Discussion"                                                
             <[EMAIL PROTECTED]                                             
                 ache.org>                                                 
                                                                           
                                                                           




No, what you have looks right to me.
I'd recommend creating the simplest-possible case and seeing if that works.

<h:outputText value="foo" style="#{true ? 'error' : 'body'}" />

Then build on it until you find out what is causing the failure.

Posting your stack trace might also help speed up the resolution of your
issue.


On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> hi,  yeah I meant styleClass.
>
> I've tried a lot of combinations and they all seem to get flagged as an
> error in EL syntax
> by MyEclipse, and the page causes an exception when I try to bring it up
in
> tomcat.
>
> Maybe there are other ways to do the same thing? I just want to change
the
> styleClass
> on a label depending on whether the field failed some edit.
>
> Thank you for responding, any other hints, guidance are appreciated.
> Tom
>
>
>
>
>              "Mike
>              Kienenberger"
>              <[EMAIL PROTECTED]
To
>              om>                       "MyFaces Discussion"
>                                        <[email protected]>
>              08/16/2006 07:04
cc
>              PM
>
Subject
>                                        Re: has anyone used EL with a jsp
>              Please respond to         style tag?
>                  "MyFaces
>                 Discussion"
>              <[EMAIL PROTECTED]
>                  ache.org>
>
>
>
>
>
>
> On 8/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > I'm trying to do something like this
> >
> > <h:outputLabel for="foo" style="#{someBean.boolean ? 'error' : 'body'}"
>
> I haven't done this, but I've seen others post similar code.  Looks good
to
> me.
> Try replacing 'someBean.boolean' with 'true' and 'false' and see if it
> does what you expect.
>
> Is this a 'style' or a 'styleClass' attribute?
>
>
>
>
>
> This message is intended for the recipient only and is not meant to be
forwarded or distributed in any other format. This communication is for
informational purposes only.  It is not intended as an offer or
solicitation for the purchase or sale of any financial instrument, or
security, or as an official confirmation of any transaction.  Putnam does
not accept purchase or redemptions of securities, instructions, or
authorizations that are sent via e-mail.   All market prices, data and
other information are not warranted as to completeness or accuracy and are
subject to change without notice.  Any comments or statements made herein
do not necessarily reflect those of Putnam, LLC (DBA Putnam Investments)
and its subsidiaries and affiliates.  If you are not the intended recipient
of this e-mail, please delete the e-mail.
>




 
This message is intended for the recipient only and is not meant to be 
forwarded or distributed in any other format. This communication is for 
informational purposes only.  It is not intended as an offer or solicitation 
for the purchase or sale of any financial instrument, or security, or as an 
official confirmation of any transaction.  Putnam does not accept purchase or 
redemptions of securities, instructions, or authorizations that are sent via 
e-mail.   All market prices, data and other information are not warranted as to 
completeness or accuracy and are subject to change without notice.  Any 
comments or statements made herein do not necessarily reflect those of Putnam, 
LLC (DBA Putnam Investments) and its subsidiaries and affiliates.  If you are 
not the intended recipient of this e-mail, please delete the e-mail.

Reply via email to