You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Shabada, Gnaneshwer" <sh...@toysrus.com> on 2004/10/12 18:14:17 UTC

logc:equal with displaytag in Struts

Hello All,

I am using DisplayTag in my Struts App to display a list of results. One of
the columns is shown as a hyperlink to show the details for that row on a
different screen. Now, I want to be able to make this column as a hyperlink
only for certain authorized users like admins. I could have used
<logic:equal> tag but not sure how to put that with the Display Tag. Below
is my code. Normally I would use the href tag but want to use it only for
admin access otherwise it should be displayed as normal column.

<display:table name="sessionScope.searchResults" pagesize="5"
defaultsort="2" defaultorder="descending" export="true"
	
id="register">
	<display:column property="lastName" title="Last Name"
sortable="true" headerClass="sortable"
href="/registration/viewRegistration.do" 
	
paramId="memberName" paramProperty="memberName" />

</display:table>

Is there anyways I could do that in between <display:column> tag??

Thanks for your help
Gnan


======================================================================== 
This email message is for the sole use of the intended recipient (s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. To reply to our email administrator directly, send
an email to EmailAdmin@toysrus.com. 
Toys "R" Us, Inc.

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


RE: logc:equal with displaytag in Struts

Posted by Chris Bredesen <ch...@expnews.com>.
You can open up the <display:column> element and use the variable
"register" (set as the id param on your display:table) in its body to
access the column's value bean.  Then you can do any other logic you
wish on the fly. You'd need to generate the href yourself in this case.

HTH,

Chris

> -----Original Message-----
> From: Shabada, Gnaneshwer [mailto:shabadag@toysrus.com] 
> Sent: Tuesday, October 12, 2004 12:14 PM
> To: 'Struts Users Mailing List'
> Subject: logc:equal with displaytag in Struts
> 
> 
> 
> Hello All,
> 
> I am using DisplayTag in my Struts App to display a list of 
> results. One of the columns is shown as a hyperlink to show 
> the details for that row on a different screen. Now, I want 
> to be able to make this column as a hyperlink only for 
> certain authorized users like admins. I could have used 
> <logic:equal> tag but not sure how to put that with the 
> Display Tag. Below is my code. Normally I would use the href 
> tag but want to use it only for admin access otherwise it 
> should be displayed as normal column.
> 
> <display:table name="sessionScope.searchResults" pagesize="5" 
> defaultsort="2" defaultorder="descending" export="true"
> 	
> id="register">
> 	<display:column property="lastName" title="Last Name" 
> sortable="true" headerClass="sortable" 
> href="/registration/viewRegistration.do" 
> 	
> paramId="memberName" paramProperty="memberName" />
> 
> </display:table>
> 
> Is there anyways I could do that in between <display:column> tag??
> 
> Thanks for your help
> Gnan
> 
> 
> ==============================================================
> ========== 
> This email message is for the sole use of the intended 
> recipient (s) and may contain confidential and privileged 
> information. Any unauthorized review, use, disclosure or 
> distribution is prohibited. If you are not the intended 
> recipient, please contact the sender by reply email and 
> destroy all copies of the original message. To reply to our 
> email administrator directly, send an email to 
> EmailAdmin@toysrus.com. 
> Toys "R" Us, Inc.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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