struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prem_gadgetquest <gadgetqu...@rediffmail.com>
Subject style display for html:text or any control
Date Fri, 28 Sep 2007 15:21:07 GMT

I have lots of control (textbox, combobox n all.....) in my page..what I want
is....... when user logs in he shud be able to see contorls in editable
format or noneditable format depending upon his role.

Now in non struts ie. simple jsp page i wud hav done this way

String jsEdit="";
if(sCurrentUserRoleName.equalsIgnoreCase("Admin")
{
    jsEdit="class='nonedit' " //nonedit is defined by me!
}
else
{
   jsEdit="class='edit' "
}
<input type="text" name="title" value="<%=jsTitle%>" size="30" maxlength="5"
<%=jsEdit%>/>

if same thing i wanna do it in struts then .......

<html:text property="txtTitle" size="30" maxlength="5" <%=jsEdit%>/> //yes
incase of struts i m using styleClass and not class attribute of the
html:text field
 above snippet flashes error mark ..saying unterminated html:text tag...m
sure its not reg. terminating html tag...but there's some way to display
this control with variable ...please guide me best way..


Thanks.:working:
-- 
View this message in context: http://www.nabble.com/style-display-for-html%3Atext-or-any-control-tf4535191.html#a12942693
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message