This code really should map directly over to the Struts html:text,
select, and options tags without any difficulty. The list would be
created in the Struts action, and the forwarded to the JSP in the
request. 

In the Javascript, be sure to use the html:rewrite tag if they need to
be logged in to use the application. 

Here's an example. 

<script>
<!--
function doRecord(aRecord) {
  aBase = '<html:rewrite forward="itemPreview"/>';
  HC_doOpenRemote(aBase + '?item=' +
aRecord,'preview','*','600','scrollbars','form');
}
// -->
</script>

This opens a remote window that displays a related record, based on the
item key (passed as "aRecord). 

The doRecord script can be called like this:

<a href='javascript:doRecord(<bean:write name="row"
property="item"/>)'><bean:write name="row" property="item"/></a>

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Building Java web applications with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Sidhartha Jain wrote:
> 
> Hi
> Could anyone suggest a good way to code these lines in struts.I Am converting normal 
>JSP to a struts JSP and launchsearch is an Javascript function which is to be 
>called.I am totally confused and wanna do it in struts .
> 
> 
> LinkedList list = (LinkedList) pd.getValue(field);
> out.println("<INPUT TYPE='HIDDEN' NAME='" + field + "'/>");
> out.println("<SELECT NAME='" + field + "Sel'>");
> Iterator iter = list.iterator();
> while(iter.hasNext())
> {
> BioClass b = (BioClass) iter.next();
> if (b != null){}
> out.println("<OPTION VALUE='" + b.getAccNum() + "'>" + b + "</OPTION>");
> }
> out.println("</SELECT>");
> out.println("<BR> <A HREF='JavaScript: launchSearch(document.editForm." + field + 
>"Sel, document.editForm." + field + ", true)'>Add</A>");
> 
> out.println("&nbsp; &nbsp; &nbsp; <A HREF=\"JavaScript: 
>launchEdit(document.editForm." + field + "Sel, document.editForm." + field + ",true, 
>'" + fia[i].getType() + "')\">Add New</A>");
> 
> Thanks in Advance
> 
> Sidh
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to