tags:

views:

91

answers:

2

I have come in a situation where I need to create a hiperlink for each entry in collection following is my code..

       <td><a href="#" onclick="javascript:openWindow(--------)">Click 

How can i get ${current.product_id} value in blank space... so that i can pass my value to next jsp for internal processing....

+1  A: 

I'm not familiar with struts, but won't this do the trick?

<td><a href="#" onclick="javascript:openWindow(<%=current.getProductId()%>)">Click
RonK
I respect your answer but that wont work because while iteration we cant use id any where else..thanks
Rozer
@Rozer: And how do you think your method call would be different for each link then? Or do you want to do the same thing no matter what on click of every link?
Adeel Ansari
yes i have done it in different way, have to use javascript but achieved the same.
Rozer
A: 

How about this?...

<javascript>
  var hasEditRightsJSProp = <s:property value="#hasEditRights" default="false" />;
  function openWindow() {
    window.open(url+"&param1="+hasEditRightsJSProp,'name','height=200,width=150'); 
  }
<javascript>
<td><a href="#" onclick="javascript:openWindow()</td>

I dont like programs that open popups, but if you reall do and you want to pass parameter over the URL then see the code above.

Hope that helps Jeff Porter

jeff porter