If you want to be struttier you should try using <html:rewrite> instead of
that scriptlet stuff. Html:rewrite resolves an url just like html:link, but
without generating all of the <a href> html.

If you use javascript a lot for dialogs and popups, it's fairly trivial to
create a custom tag that extends the Link Tag and generates the HTML however
you like it. 

- Todd

-----Original Message-----
From: Tuan H. Le [mailto:tuan.le@;phsadc.com]
Sent: Wednesday, 23 October 2002 6:17 AM
To: Struts Users Mailing List
Subject: RE: <html:link> with JavaScript


ok, I replaced <html:link> with <a href> and it works fine. It seems like
the scriptlet <%=....%> can not be parsed within the <html:link> tag.

Thanks!
Tuan

-----Original Message-----
From: Tuan H. Le 
Sent: Tuesday, October 22, 2002 1:01 PM
To: 'Struts Users Mailing List'
Subject: RE: <html:link> with JavaScript


Jeff,

Thanks for your response! I tried your suggestion, but it seems that
<%=employee.getId() %> does not get parsed within <html:link> tag. When I
view the html source on the browser, it shows

<a href="JavaScript:void()" onclick="openModal(
'/editSalary.do?id=<%=employee.getEmployeeId() %>' )"><img src....>

Other suggestions?

Thanks!
Tuan

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:Jeff_Mychasiw@;nlgroup.ca]
Sent: Tuesday, October 22, 2002 11:02 AM
To: Struts Users Mailing List
Subject: Re: <html:link> with JavaScript




Try:
<logic:iterate id="employee" name="employeeList" scope="request" type
  ="com.abc.EmployeeVO" ...>
  <td>
  <html:link href="JavaScript:void()" onclick="openModal('/editSalary.do?<%
  = employee.getId() %>')"><img src="common/images/edit.gif" width="9"
  height="18" border="0" alt="edit"></html:link>
  </td>

</logic:iterate>




"Tuan H. Le" <[EMAIL PROTECTED]> on 10/22/2002 12:33:02 PM

Please respond to "Struts Users Mailing List"
       <[EMAIL PROTECTED]>

To:    "Struts Users Mailing List (E-mail)"
       <[EMAIL PROTECTED]>
cc:

Subject:    <html:link> with JavaScript


Hi

Can some one please show me a tip on how to pass a dynamic value into a
JavaScript function within <html:link> tag? What I need is to pass an
employee ID in the openModal( '/editSalary.do?id=### ).

Here's my code


<script language="javaScript">
  function openModal( theURL ){
 window.showModalDialog(theURL,'','dialogWidth:662px;, dialogHeight:180px;
 help:no; scroll:no; status:no; center:yes; resizable:no; unadorned:yes;');
 }
</script>

<logic:iterate id="employee" name="employeeList" scope="request" type
  ="com.abc.EmployeeVO" ...>
  <td>
  <html:link href="JavaScript:void()" onclick="openModal
  ('/editSalary.do')"><img src="common/images/edit.gif" width="9" height
  ="18" border="0" alt="edit"></html:link>
  </td>

</logic:iterate>


I know how to create a <html:link> that generates an HREF with a passing
dynamic parameter value as such

<html:link href="/editSalary.do" paramId="id" paramName="employee"
paramProperty="employeeId" target="_blank">

The code above works fine, but I need a way to open a modal dialog window
with a specific size.

Thanks in advance!
Tuan





(See attached file: winmail.dat)
--
To unsubscribe, e-mail:   <
mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <
mailto:struts-user-help@;jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to