You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Pyeron <jp...@pdinc.us> on 2012/06/03 17:15:22 UTC

RE: [struts-user] Can I use in

> -----Original Message-----
> From: samsongbest 
> Sent: Sunday, June 03, 2012 10:44
> To: user
> Subject: [struts-user] Can I use <s:if> in <s:textfield>
> 
> Can I use <s:if> in <s:textfield> to control using different 
> cssClass? Always failed when I tried.
> But it works in <input type="text">.

Since the tag belongs to a taglib, you cannot. But you can set a var using
conditional logic, and then using the var as an expression in the <s:textfield
cssClass="#var" />


See: 

http://struts.apache.org/2.x/docs/set.html
http://struts.apache.org/2.x/docs/if.html

-Jason



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 


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