You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by SP...@ixl.com on 2001/01/18 18:36:44 UTC

Hyperlink - Need help

Hi,

I need to include a parameter for a hyperlink. I have enumerate which
operates just like iterate.

Here is my code:
	<struts:enumerate id="product" name="dispProductsBean"
property="products" >
		<tr>
		    <td align="left">
		      <struts:htmlProperty name="product"
property="productID"/>
			  <struts:hidden name="product"
property="productID"/>
		    </td>
		    <td align="left">
		      	<struts:link href="dispCategories.do?id="> Here I
want to add the value of the hidden field. 
			  		<struts:htmlProperty name="product"
property="name"/>
				</struts:link>
		    </td>
		    <td align="left">
		      <struts:htmlProperty name="product"
property="description"/>
		    </td>
 		</tr>
	</struts:enumerate>

Can you please help?
Sharmila
Sharmila Pandith
Software Engineer
iXL Inc.

phone: 212-500-5180
AIM: spandith
Yahoo: spandith
MSN: spandith

This message is intended only for the use of the Addressee and may contain
information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended
recipient, dissemination of this communication is prohibited. If you have
received this communication in error, please erase all copies of the message
and its attachments and notify us immediately. 



Re: Hyperlink - Need help

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
SPandith@ixl.com wrote:

> Hi,
>
> I need to include a parameter for a hyperlink. I have enumerate which
> operates just like iterate.

> Here is my code:
>         <struts:enumerate id="product" name="dispProductsBean"
> property="products" >
>                 <tr>
>                     <td align="left">
>                       <struts:htmlProperty name="product"
> property="productID"/>
>                           <struts:hidden name="product"
> property="productID"/>
>                     </td>
>                     <td align="left">
>                         <struts:link href="dispCategories.do?id="> Here I
> want to add the value of the hidden field.
>                                         <struts:htmlProperty name="product"
> property="name"/>
>                                 </struts:link>
>                     </td>
>                     <td align="left">
>                       <struts:htmlProperty name="product"
> property="description"/>
>                     </td>
>                 </tr>
>         </struts:enumerate>
>
> Can you please help?
> Sharmila
>

The Struts 1.0 version of the <html:link> tag can do what you are after.  You
would say this:

    <html:link href="dispCategories.do" paramId="id"
     paramName="product" paramProperty="name"/>

which will render a hyperlink to

    dispCategories.do?id=xxxxx

where "xxxxx" is the name of the current product.

Craig McClanahan