You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by patwary rao <pa...@yahoo.com> on 2005/11/25 02:01:55 UTC

problem with form bean properties

Hi all,
     I want to know is it possible to send form bean
property to the custom tag.basically i want to display
static text instead of text box if the user has read
only ability to the page else show him text box.user 
role is checked in the custom tag surrounding the text
box . i want to implement the same logic for all the
html elements like drop down list ,check box etc.
thanks
shiva



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: problem with form bean properties

Posted by Laurie Harper <la...@holoweb.net>.
patwary rao wrote:
> Hi all,
>      I want to know is it possible to send form bean
> property to the custom tag.basically i want to display
> static text instead of text box if the user has read
> only ability to the page else show him text box.user 
> role is checked in the custom tag surrounding the text
> box . i want to implement the same logic for all the
> html elements like drop down list ,check box etc.
> thanks
> shiva

I'm not sure what you mean by 'send form bean property to the custom 
tag' but I think what you're asking for is a way to display either 
un-editable text or a text box conditionally according to the user's 
role. The Struts HTML tags don't support this directly, but you can 
easily wrap them with a role check, something like (untested):

   <logic:present role="CanEdit">
     <html:text property="..." .../>
   </logic:present>
   <logic:notPresent role="CanEdit">
     <bean:write property="..."/>
   </logic:notPresent>

HTH,

L.


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