bhaarat Sharma wrote:
Hello
I am using struts 1 to show a link to the user like this
<html:link
page="/editProjectMonitor.do" paramId="report_id"
paramName="report"
paramProperty="reportId" target="_blank">
Edit</html:link>
However I want this link to open up from Javascript instead! For javascript
I have a code like the following
function openPopup() {
windowReference = window.open('/cmrs/editProjectMonitor.do?report_id=<%=WHAT
TO PUT HERE? SO I CAN GETT report_id value%>','windowName');
if (!windowReference.opener)
windowReference.opener = self;
}
what can i pass so that report_id value will come. I know in struts2 I could
have used the s:property tag...is there something similar in struts1?
Antonio is right, the onclick attribute is probably the easiest way to
do this, but to answer the question: you can use an EL expression if you
have them available, as in:
...window.open('...?report_id=${report.reportId}'
or, if you don't have JSTL available in your container, you can use the
bean:write tag:
...window.open('...?report_id=<bean:write name="report"
property="reportId"/>'
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]