Hi Ram,
First of all, please use plain text when posting on the mailinglist. Thanks :-)
And now, back to your question:
If I understand you correctly, you would like to display a hyperlink if the column
value is 'Y'.
You'll need to make a decorator to fix this. Its pretty simple stuff. Your decorator
may look something like:
import org.displaytag.decorator.ColumnDecorator;
public class LinkDecorator implements ColumnDecorator {
public String decorate(Object columnValue) {
if(columnValue.equals("Y")
return "<a href='someURLstuff?shortName=" + columnValue.toString()+ ">" +
columnValue.toString() + "</a>";
else
return columnValue;
}
}
-------------
You call it by:
<display:column property="shortName" title= "Agency" sort="true" decorator="your class
path.LinkDecorator" />
------
Ok?
Cheers,
Bard
---------
<BR><BR>----- Original Message -----<BR>From: "Reddy, Ram (OFT)" <[EMAIL
PROTECTED]><BR>Date: Wed, 29 Oct 2003 16:18:41 -0500<BR>To: <[EMAIL
PROTECTED]><BR>Subject: [displaytag-user] Display tag problem...<BR><BR><html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi, </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I am unable to display hyperlinks based on conditions in
display tag. Suppose if I have condition like</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>����������������������� If(shortName.equals(�Y�){</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>����������������������������������� <a
href=��.><%=shortName%></a></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>����������������������� }else{</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>����������������������������������� shortName;</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>����������������������� }</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>�</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>It is setting hyperlinks to all shortName values instead of
required ones�.Is there any implementation for this�.</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>�</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'><</span></font><font size=2 color="#3f7f7f" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#3F7F7F;background:white'>display:table
</span></font><font size=2 color="#7f007f" face=Courier><span style='font-size:
10.0pt;font-family:Courier;color:#7F007F;background:white'>width</span></font><font
size=2 color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"95%" </span></font><font size=2 color="#7f007f"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#7F007F;
background:white'>name</span></font><font size=2 color=black face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black;background:white'>=</span></font><font
size=2 color="#2a00ff" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#2A00FF;background:white'>"searchresult" </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>pagesize</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"25" </span></font><font size=2 color="#7f007f"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#7F007F;
background:white'>requestURI</span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>=</span></font><font size=2 color="#2a00ff" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#2A00FF;background:white'>"./searchresult.jsp"</span></font><font
size=2 color=teal face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:teal;background:white'>></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>� <</span></font><font size=2 color="#3f7f7f"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#3F7F7F;
background:white'>display:setProperty </span></font><font size=2 color="#7f007f"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#7F007F;
background:white'>name</span></font><font size=2 color=black face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black;background:white'>=</span></font><font
size=2 color="#2a00ff" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#2A00FF;background:white'>"sort.behavior" </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>value</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>""</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>></</span></font><font size=2 color="#3f7f7f"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#3F7F7F;
background:white'>display:setProperty</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font><font size=2 color=teal face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:teal;background:white'><</span></font><font
size=2 color="#3f7f7f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#3F7F7F;background:white'>display:column </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>property</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"lastName" </span></font><font size=2
color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:#7F007F;background:white'>title</span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>=</span></font><font size=2 color="#2a00ff" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#2A00FF;background:white'>"Last
Name" </span></font><font size=2 color="#7f007f" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#7F007F;background:white'>sort</span></font><font
size=2 color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"true"</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>/></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font><font size=2 color=teal face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:teal;background:white'><</span></font><font
size=2 color="#3f7f7f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#3F7F7F;background:white'>display:column </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>property</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"firstName" </span></font><font size=2
color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:#7F007F;background:white'>title</span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>=</span></font><font size=2 color="#2a00ff" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#2A00FF;background:white'>"First
Name"� </span></font><font size=2 color="#7f007f" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#7F007F;background:white'>sort</span></font><font
size=2 color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"true"</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>/></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font><font size=2 color=teal face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:teal;background:white'><</span></font><font
size=2 color="#3f7f7f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#3F7F7F;background:white'>display:column </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>property</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"phoneNumber" </span></font><font size=2
color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:#7F007F;background:white'>title</span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>=</span></font><font size=2 color="#2a00ff" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#2A00FF;background:white'>"Phone"�
</span></font><font size=2 color="#7f007f" face=Courier><span style='font-size:
10.0pt;font-family:Courier;color:#7F007F;background:white'>sort</span></font><font
size=2 color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"true"</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>/></span></font><font size=2 color=black face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black;background:white'>
</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font><font size=2 color=teal face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:teal;background:white'><</span></font><font
size=2 color="#3f7f7f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#3F7F7F;background:white'>display:column </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>property</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"shortName" </span></font><font size=2
color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:#7F007F;background:white'>title</span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>= </span></font><font size=2 color="#2a00ff" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#2A00FF;background:white'>"Agency"
</span></font><font size=2 color="#7f007f" face=Courier><span style='font-size:
10.0pt;font-family:Courier;color:#7F007F;background:white'>sort</span></font><font
size=2 color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"true" </span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>/></span></font><font size=2 color=black face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black;background:white'>��
</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font><font size=2 color=teal face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:teal;background:white'><</span></font><font
size=2 color="#3f7f7f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#3F7F7F;background:white'>display:column </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>property</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"cityName" </span></font><font size=2
color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:#7F007F;background:white'>title</span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>=</span></font><font size=2 color="#2a00ff" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#2A00FF;background:white'>"City"�
</span></font><font size=2 color="#7f007f" face=Courier><span style='font-size:
10.0pt;font-family:Courier;color:#7F007F;background:white'>sort</span></font><font
size=2 color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"true"</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>/></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font><font size=2 color=teal face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:teal;background:white'><</span></font><font
size=2 color="#3f7f7f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#3F7F7F;background:white'>display:column </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>property</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"street1" </span></font><font size=2 color="#7f007f"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#7F007F;
background:white'>title</span></font><font size=2 color=black face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black;background:white'>=</span></font><font
size=2 color="#2a00ff" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#2A00FF;background:white'>"Location"� </span></font><font
size=2 color="#7f007f" face=Courier><span style='font-size:10.0pt;font-family:
Courier;color:#7F007F;background:white'>sort</span></font><font size=2
color=black face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:black;background:white'>=</span></font><font size=2 color="#2a00ff"
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:#2A00FF;
background:white'>"true"</span></font><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'>/></span></font><font size=2 color=black face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black;background:white'>����
</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=teal
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:teal;
background:white'></</span></font><font size=2 color="#3f7f7f" face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:#3F7F7F;background:white'>display:table</span></font><font
size=2 color=teal face=Courier><span style='font-size:10.0pt;font-family:Courier;
color:teal;background:white'>></span></font><font size=2 color=black
face=Courier><span style='font-size:10.0pt;font-family:Courier;color:black;
background:white'>� </span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black'>�</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black'>thanks,</span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face=Courier><span
style='font-size:10.0pt;font-family:Courier;color:black'>-Ram</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>�</span></font></p>
</div>
</body>
</html>
--
___________________________________________________
OperaMail free e-mail - http://www.operamail.com
OperaMail Premium - 28MB, POP3, more! US$29.99/year
Powered by Outblaze
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
displaytag-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-user