Passing value from JSP to Action in Struts

Hi,
I am populating JSP page with rows retrieved from the database and
represented as a List of Beans in forEach loop:
<c:forEach var="list" items="${OperationsForm.OperationsList}">
<c:choose>
<c:when test="${list.isCompleted =='Y'}" >
<td width="100">Completed</td>
<td width="100"> </td>
</c:when>
<c:otherwise>
<td width="100">Pending</td>
<td width="100"><input type="image" onclick="
rowId=value; form.action='action.do?command=notify'"
value="${list.OperationId}" />
</td>
</c:otherwise>
</c:choose>
</tr>
</c:forEach>
Have hidden field: html:hidden property="rowId" value="-1"/>
User is clicking the button corresponding to one of the rows
and I need to pass the value of that rowId to the Action class, so it does
something in the database [action completed]
Now how do I pass it , is that the right way of doing it with calling
request.getSession().getAttribute(rowId) in the Action class ?
As of now I am getting Javascript error "Object doesn't support this
property or method", complaining about rowId=value;
Using Struts 1.3
Please help !
TIA,
Oleg.

So what you are saying is that I should add rowId here:
<input type="image" onclick="form.action='action.do?command=notify&rowId='
${list.OperationId}"/> , correct ?
I am not sure that it will work, especially with Struts tag.
I will probably try something like:
<html:submit onclick="form.action='action.do?command=notify'" value="${list.OperationId}">
I am relatively new to Struts, so now sure what will work or not and how to do it better. How do I catch the submitted value in the Action in either of these 2 cases, via action.getSession().getProperty("rowId") /
action.getSession().getProperty("submit") ?
I would probably do it as a URL rather than changing the action of the form.I will have to create a new action anyway to process that row [which is sending user e-mail regarding that row data/event].
Is the id the only thing you have to pass in?
Or do you need other values from the screen?Selected rowId is probably the only thing I care about, can access values from the Form in Action.
Thank you,
Oleg.

Similar Messages

  • Passing value from JSP to JApplet

    Hello,
    I am stuck up with a problem, can anyone please tell me how do i pass a value from a JSP page
    to a JApplet,
    and the parameter passed through JSP should be displaed in the JTextArea.
    It would be kindful if any of you could help.
    Thanks
    Sanam

    hello,
    thanks for reply.
    I know how to pass parameters from html,
    I want to pass values from jsp page,
    and i dono how to do it, may be we cann pass values through url connection but i dono how.
    if anone knows plz help me in solving this.
    i hvae posted my applet code.
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.JToolBar;
    import javax.swing.JButton;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    <applet code = "DocApplet" width = 500 height =5000>
    </applet>
    public class DocApplet extends JApplet
         private JPanel jp;
         private Container cp;
         private JTextArea jt;
         private JToolBar tb;     
         private JScrollPane sp;
         private String annotation;
         private String url;
         private Connection con;
         private Statement stmt;
         public void init()
              jp = new JPanel();
              cp = getContentPane();
              jt = new JTextArea();
              tb = new JToolBar();
              sp = new JScrollPane(jt);
              repaint();
         public void start()
              jp.setLayout(new BorderLayout());
              jp.add(tb, BorderLayout.NORTH);
              jp.add(sp, BorderLayout.CENTER);
              jt.setBackground(Color.BLACK);
              jt.setForeground(Color.WHITE);
              setContentPane(jp);
              addButtons(tb);
              repaint();
         public void run()
              repaint();
         public void paint()
         private void addButtons(JToolBar tb)
              JButton button = null;
              button = new JButton("Save");
              button.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
              tb.add(button);
    }

  • How to pass value from jsp to java bean

    I have huge problem . How to pass value from jsp value to java bean.Please replay me soon

    Use the <jsp:setProperty> tag. There are several ways to use it. The one you probably want is:
    <jsp:setProperty name="bean_name"  property="property_name"  value="the_value_you_want_to_set"/>

  • Passing value from JSP to scriptlet

    Hi
    I am trying to find a way to pass a value from jsp to the scriptlets, i.e.
    <c:set var="testValue" value="123" />
    <%
    System.out.println(testValue);
    %>
    the above code just demonstrates what I was trying to achieve, by passing the value from the jsp into the scriptlet.
    Can someone tell me if there's an easy way to do this?
    Thank you.

    Note, using scriptlet code on your page is generally something to be avoided. 99% of what you should be doing on a JSP page can be done with EL/JSTL. If you can't do it with EL/JSTL then it probably belongs in a servlet/bean.
    I always aim for 100% scriptlet free jsp pages.
    Having said that, I can still answer your question: EL attributes are stored in the scope - page, request, session, application
    ${testValue} is equivalent to pageContext.findAttribute("testValue").
    The <c:set> tag example doesn't specify a scope, so therefore you could get it like this:
    <c:set var="testValue" value="123" />
    <%
    String testValue = (String)pageContext.getAttribute("testValue");
    System.out.println(testValue);
    %>alternatively exploit the feature of the useBean tag that creates a scriptlet variable:
    <c:set var="testValue" value="123" />
    <jsp:useBean id="testValue" type="java.lang.String"/>
    <%
    System.out.println(testValue);
    %>Note that the EL variable and the Scriptlet variable are initially pointing at the same String.
    But changing the string in scriptlet code will change the value it is pointing at, while leaving the EL variable untouched.
    If you have a List in scope, and sharing it between EL and scriptlet variables then any changes to the list would be reflected because they both point at the same List object.
    cheers,
    evnafets

  • Passing value from JSP to JSPDynPage onclick of link

    Hi,
    I have extracted a value in the JSP page and i want to send this value back to the JSPDynPage on click of a link(the link is dependent on the value).
    How can i do that?

    hi Sujoy,
    you can pass values by using beans and display the passed data in a new jsp page.
    firstly create a jsp page,that accepts user data,say for example i am placing a text box and a button,
    next,create a jspdyn page---
    private final static int INITIAL_STATE = 0;
        private final static int FINAL_STATE = 1;
        private int state = INITIAL_STATE;
        private final static String BEAN_KEY="nameBean";
        public void doInitialization(){
          IPortalComponentRequest request=(IPortalComponentRequest) this.getRequest();
          IPortalComponentContext ctxt=request.getComponentContext();
          displayNameBean mybean = new displayNameBean();
          ctxt.putValue(BEAN_KEY,mybean);
    public void doProcessAfterInput() throws PageException {
             InputField myInputField = (InputField) getComponentByName("user_name");
    if (myInputField != null) {
    IPortalComponentRequest request=(IPortalComponentRequest) this.getRequest();
    IPortalComponentContext ctxt = request.getComponentContext();
                 displayNameBean mybean1=(displayNameBean)ctxt.getValue(BEAN_KEY);
                   mybean1.setName(myInputField.getValueAsDataType().toString());
        public void doProcessBeforeOutput() throws PageException {
          switch (state){
               case INITIAL_STATE:
               this.setJspName("loginPage.jsp");
               break;
               case FINAL_STATE:
               this.setJspName("successloginPage.jsp");
               break;
        public void onButtonClick(Event event) throws PageException {
             state=FINAL_STATE;       
    finally display this value in a new jsp page as follows--
    <jsp:useBean id="nameBean" scope="application" class="NewProject.bean.displayNameBean" />
    <%@ taglib uri= "tagLib" prefix= "hbj"%>
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
    <hbj:textView
         id="welcome_note"
         design="HEADER2">
         <% 
         welcome_note.setText
         (nameBean.getName());
         %>
    as simple as that!!
    regards
    SwarnaDeepika
    P.S:Please reward points for helpful answers.

  • How to pass value from JSP to Javascript?

    I want to pass 2 integers to Javascript to do checking? How can I do that?

    Well, it is very simple, Follow these steps.
    1. Have a form with fields
    2. On submit validate the form using javascript
    3. If the javascript returns false do not submit the form
    4. if the javascript returns true submit the form
    5. The destination jsp page will handle the db operations.
    1. <form name="frm1" action="dbcheck.jsp">
    <input type="text" name="txt1">
    <input type="button" value="submit" onClick="return validate();">
    </form>
    put the above piece of code in the <body> tag
    2. Upon submit the js function validate() will be called :
    <script language="javascript">
    function validate() {
    if(document.frm1.txt1.value="") {
    alert("enter text");
    return false;
    else {
    document.frm1.submit(); // i am not sure whether the () after submit is required or not
    put the above piece of code in the <head> tag.
    3. Now when the submit happens, the control goes to the dbcheck.jsp
    this is dbcheck.jsp:
    <%
    String str = (String) request.getParameter("txt1");
    ------other db operations go here --------
    %>
    "txt1" is the field name of the textbox from the form u previously submitted.
    all da best

  • Passing data from JSP to Action w/o form bean

    I would like to invoke an action using the content of a table cell displayed on
    a JSP as the action parameter. For example, assume the JSP has a table displaying
    the data attributes for an Employee (i.e. name, age, salary, department, etc.).
    I would like clicking the data vale for an attribute to display more detailed
    information about that attribute. So if I click on department, it would invoke
    a getDepartmentDetails action that would get the attributes for that department
    and display them on second JSP. The department attribute on the first JSP would
    be an HTML anchor. Since the getDepartmentDetails action would not have a form
    bean, how could I pass it the department id? I've heard that SP2 will support
    something called page inputs. Will this resolve this problem? Thanks.

    I have a table listing companies...I had a link over the company code to call an
    action selectCompany so that it would display a company info page.
    I did this...
    <td><netui:anchor action="selectCompany"><netui:parameter name="companyId" value="{container.item.companyId}"></netui:parameter><netui:label
    value="{container.item.companyCd}"></netui:label></netui:anchor></td>
    when I highlighted over the html link it would show
    http://localhost:7001/Admin/financialInstitution/selectCompany.do?companyId=27
    in my selectCompany action...to retrieve the parms, i did this...
    String compId = this.getRequest().getParameter("companyId");
    int iCompId = 0;
    // A company object is loaded based on the companyId parameter.
    try {
    iCompId = Integer.parseInt( compId );
    } catch (Exception exc) {
    hope that helps,
    Tom
    "Fred Criscuolo" <[email protected]> wrote:
    >
    I would like to invoke an action using the content of a table cell displayed
    on
    a JSP as the action parameter. For example, assume the JSP has a table
    displaying
    the data attributes for an Employee (i.e. name, age, salary, department,
    etc.).
    I would like clicking the data vale for an attribute to display more
    detailed
    information about that attribute. So if I click on department, it would
    invoke
    a getDepartmentDetails action that would get the attributes for that
    department
    and display them on second JSP. The department attribute on the first
    JSP would
    be an HTML anchor. Since the getDepartmentDetails action would not have
    a form
    bean, how could I pass it the department id? I've heard that SP2 will
    support
    something called page inputs. Will this resolve this problem? Thanks.

  • Passing value from jsp to java

    Hi
    Thanks for reading my query.I am having a jsp page which gets the input from the user from a confirm box(javascript). This input i need to process in my java class.how can i do that
    Regards
    Venki

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

  • Values from JSP to Struts Action Class

    Dear All,
    Am working on a small struts project, i want to get values from JSP in the Action class, i tried with sending variables using request through URL, it works fine, any other way is there to send the values from JSP to action class. Am not having any input fields in the JSP.I have links.
    Thanks,
    vyrav.

    I have a dispatch action for that am calling the action like this viewfiles.do?parameter=edit, and i have to send a variable ID from the same page, so am doing like this through java script, viewfiles.do?parameter=edit&id=10. Am able to get the id in the dispatch action edit, but when i start tomcat with security manager its not calling the action itself and its giving accesscontrol exception, but when i directly type viewfiles.do in URL its calling the action.
    I dont know wats the problem, tomcat security manager not allowing this. Please help me.
    Thanks,
    vyrav.

  • Passing values from javascript in pop up window to parent jsp

    Hi
    I am trying to pass values from a pop up window to the main window that popped this child window , with the idea to have the parent window refresh itself with value from pop up window.But the values are not going through.I do a request on the hidden variable but when the parent
    jsp refreshes , the variable is still null...
    The following is the code i have .
    Parent jsp:a.jsp
    <form name='summary'>
    <input type=hidden name=customerid value="">
    <input type="button" class="textButton" name="action" value="customerlist" onClick="javascript:openWin('b.jsp','800','350')">
    <script>
    function openWin(loc, w, h) {
    var newWin = window.openloc,"HTML",'dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + w + ',height=' + h);
    newWin.window.focus();
    </SCRIPT>
    <%
    String optionVal = request.getParameter("customerid");%>
    var user = "<%= optionVal%>";
    </form>
    child jsp- b.jsp (pop up window)
    <script>
    function closer(){
    var val = document.formname.id.selected.value;
    window.opener.document.summary.customerid.value = val;
    window.opener.location.reload();
    </script>
    <form name = formname>
    <input type="text" name="id" value = ''>
    <input type="button" class="textButton" value="select"
    onClick="closer();window.close();">
    </form>
    Any ideas on what i am missing
    Thanks
    Arn

    use window.opener.document.forms[0].filedname.value = 'value u need to set'

  • Passing value from one jsp to another?

    how to pass value from one jsp to another? i have a value assigned in the link, i want to pass that value to another jsp page?
    please help with code?

    Instead of the value being passed, i am getting a null value.
    Here is my calendar code:
    <%@page import="java.util.*,java.text.*" %>
    <html>
    <head>
    <title>Print a month page.</title>
    </head>
    <body bgcolor="white">
    <%
                  boolean yyok = false;
                  int yy = 0, mm = 0;
                  String yyString = request.getParameter("year");
                  if (yyString != null && yyString.length() > 0)
                      try
                          yy = Integer.parseInt(yyString);
                                  yyok = true;
                       catch (NumberFormatException e)
                          out.println("Year " + yyString + " invalid" );
                  Calendar c = Calendar.getInstance( );
                  if (!yyok)yy = c.get(Calendar.YEAR);  
                         mm = c.get(Calendar.MONTH);
    %>
                  <table align="center">
                      <tr>
                  <td>
                       <form method=post action="calendar.jsp">
                          Enter Year : <select name="year">
    <%         
                 for(int i= yy;i<=2010;i++)
    %>
                  <OPTION VALUE= <%=i%> > <%=i%> </option>
    <%       
    %>
              </select>
                      <input type=submit value="Display">
                      </form>
                      </td>
                    </tr>
    <tr>
                     <table>
    <%!
    String[] months = {"January","February","March",
                    "April","May","June",
                    "July","August","September",
                    "October","November", "December"
    int dom[] =     {
                        31, 28, 31, 30,
                        31, 30, 31, 31,
                        30, 31, 30, 31
    %>
    <%
                int leadGap =0;
    %>
    <div id="t1" class="tip"><table border="4" cellpadding=3 cellspacing="3" width="250" align="center" bgcolor="lavender">
    <tr>
    <td halign="centre" colgroup span="7" style="color:#FF0000;">
    </colgroup>
    <tr>
    <td>
    <%
              GregorianCalendar calendar =null;
              for(int j=0;j<12;j++)
                        calendar = new GregorianCalendar(yy, j, 1);
                  int row = 1 ;
                  row = row + j;
        %>
              <table>
                <tr>
              <colgroup span="7" style="color:#FF0000;">
              </colgroup>
                </tr>
              <tr align="center">
              <th colspan=7>
                  <%= months[j] %>
                  <%= yy %>
              </th>
              </tr>
    <tr>
    <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
    </tr>
    <%
        leadGap = calendar.get(Calendar.DAY_OF_WEEK)-1;
        int daysInMonth = dom[j];
        if ( calendar.isLeapYear( calendar.get(Calendar.YEAR) ) && j == 1)
        ++daysInMonth;
        out.print("<tr>");
        out.print(" ");
          for (int h = 0; h < leadGap; h++)
           out.print("<td>");
          out.print("</td>");
        for (int h = 1; h <= daysInMonth; h++)
          out.print("<td>");
          out.print("<a href=desc.jsp>" + h + "</a>" );
          out.print("</td>");
        if ((leadGap + h) % 7 == 0)
            out.println("</tr>");
    out.println("</tr></table></div>");
    if( row%3 != 0)
    out.println("</td><td>");
    else
    out.println("</td></tr>\n<tr><td>");
    %>
    </html>I need to pass the value in 'h' to the desc.jsp page.
    my code for desc.jsp is :
    <html>
    <head>
    </head>
    <body bgcolor="lightblue">
    <form method=post action="Calenda.jsp">
    <br>
    <%= request.getParameter("h") %>
    <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
    <BR> <INPUT TYPE=SUBMIT VALUE="submit">
    </form>
    </body>
    </html>But i am not able to pass the value. The 'h' value contains all the date. i want to pass only a single date, the user clicks to the other page. please help

  • How to Pass values from XML to JSP??? Urgent Please Help me

    Hi guys,
    I am new to XML, I want to pass values from XML to JSP. I have a xml file with attributes, I should send this values to a JSP file. How is it??? Please Help guys.... its very urgent. Please send me how to do it with an example or atleast any urls related that....
    Looking for ur favourable reply.
    Thanks in advance,
    Sridhar

    in a servlet :
    parse your xml file (see how at the end of the post) and
    put the values you want in the request attributes
    request.setAttribute("value1", value1);
    ...redirect to the jsp
    in the JSP:
    get the wanted attributes:
    String value1=(String)request.getAttribute("value1");To learn how to parse a xml file, pay a look at this page, it explains how to read the XML document to build an object representation, and then how to navigate through this object to get the data
    http://labe.felk.cvut.cz/~xfaigl/mep/xml/java-xml.htm

  • Passing values between jsp pages

    Hi all,
    I am a newbie to jsp. I am trying to pass value from one jsp to another.
    Let me post the code here and make my point clear. I have 3 jsp pages and am trying to get the value into my 3rd page that was in the first page.
    This is my Test.jsp page:
    <%@page contentType="text/html"%>
    <html>
    <head><title>Test JSP Page</title></head>
    <body>
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    Testing.. JSP Page
    <FORM action='Response.jsp' method="POST">
    <input type='Text' name='get_name'>
    <input type="submit" value="Click Me">
    </FORM>
    </body>
    </html>
    This is my response.jsp page:
    <%@page contentType="text/html"%>
    <%@page import = "sun.jdbc.rowset.CachedRowSet" %>
    <html>
    <head><title>Response Page</title></head>
    <body>
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    Thank you... <%=request.getParameter("get_name") %>
    // I want to pass this get_name to my next page, but since request.getParameter returns an object and not a string, how will I capture the value and pass it to my next page.
    </body>
    </html>
    The 3rd jsp page is:
    <%@page contentType="text/html"%>
    <html>
    <head><title>JSP Page</title></head>
    <body>
    // I am trying to get the value of the name here in this page.
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    </body>
    </html>
    Your help is appreciated.
    Thanks

    Hi,
    Thanks for the reply, it works. I was wondering whether this is an efficient way of doing this. What I want to do further is to setup a connection to a database and use the value I got from my previous page to query the DB and get the results and display.
    I have see some code in the java website and a lot of people do by writting a bean /class(believe bean is just a class) and then importing it and do the things that way. I have good knowledge of OO and Java as a language and would definitely love to do it this way.
    What i think i am missing is the basic idea to doing this way. So if you could let me know how to do this using java classes I would really appreciate it. If its too much to explain can u point to some good source(URL's) that explain's this. I have searched on this and all i find is code with no good explaination.
    Thanks a lot

  • URGENT: Passing Array from JSP to a Stored Procedure

    Hi,
    Can some one please help me understanding how can I pass array from JSP page to a stored procedure in database.
    Thanks in advance.
    Jatinder

    Thanks.
    I tried ArrayExampla.java and was successful in passing array values to the stored database procedure.
    How can I use this class in JSP? Like I have first JSP where in I will collect input from the user and then submit it to the second JSP - that needs to call the ArrayExample.java to pass the values as array to the database.
    How should I call this java code in my second JSP?
    Thanks in advance.

  • Passing value from JavaScript window to form

    Hi,
    Coul'd You help me?
    I have a test form. I open new JavaScript window from this form. I generate list of authors in this window by the procedure show_list. I want to pass value from JavaScript window back to test form, but
    the command "window.opener.document.forms[idx_form].elements[idx_fld].value = val;"
    don't pass value to test form. Where is mistake?
    Thanks Vaclav
    -------------- test form --------------
    <HTML>
    <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <TITLE>Edit</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Comment out script for old browsers
    function get_list(frm, fld)
    var idx_form, idx_fld;
    idx_form = get_idx_form(frm);
    idx_fld = get_idx_field(idx_form, fld);
    var w = open ("http://vasekora/pls/portal309/ahs.RD_CISEL.SHOW_LIST" + "?startPg=1" + "&master_fld=" + "ID_AUTHOR" + "&slave_fld=" + "NAME" + "&ownr=" + "REDAKCE" + "&tbl_name=" + "AUTHORS" + "&cmd_qry=" +"" + "&idx_form=" + idx_form + "&idx_fld=" + idx_fld,"wn_Authors","width=500,height=600,resizable=yes,menubar=yes, location=yes");
    if (w.opener == null)
    w.opener = self;
    w.focus();
    function get_idx_form(p_form_name)
    var v_index, v_full_name, v_return;
    for(v_index=0; v_index < document.forms.length; v_index++)
    v_return = -1;
         v_full_name = document.forms[v_index].name.split(".");
    if (v_full_name == p_form_name)
         v_return = v_index;
              break;
    return v_return;
    function get_idx_field(idx_form, field_name)
    var v_index, v_full_name, v_return;
    for(v_index=0; v_index < document.forms[idx_form].length; v_index++)
    v_return = -1;
         v_full_name = document.forms[idx_form].elements[v_index].name.split(".");
    if (v_full_name == field_name)
         v_return = v_index;
              break;
    return v_return;
    //-->
    </SCRIPT>
    </HEAD>
    <BODY>
    <FORM NAME="f_aut_new" ACTION="javascript:testclose()" METHOD=POST TARGET="_blank">
    <INPUT TYPE="text" NAME="id_aut">
    <IMG SRC="images/list.gif" alt="Seznam" border="0" align=bottom><BR><BR>
    <INPUT TYPE="submit" VALUE="Save">
    <INPUT TYPE="reset" VALUE="Cancel">
    </FORM>
    </BODY>
    </HTML>
    -------------------- end test form --------------
    procedure show_list
    startPg integer,
    master_fld varchar2,
    show_fld varchar2,
    ownr varchar2,
    tbl_name varchar2,
    cmd_qry varchar2,
    idx_form integer,
    idx_fld integer
    is
    TYPE cur_typ IS REF CURSOR;
    c cur_typ;
    c_cnt cur_typ;
    i integer;
         pg rd_types.pages_t;
    odkaz varchar2(4000);
    bk_url varchar2(4000);
         s1 varchar2(4000);
         var_mfld integer;
         var_sfld varchar2(8000);
         bl boolean;
         var_cmd varchar2(2000);
    begin
    htp.HTMLOPEN;
    htp.HEADOPEN;
    htp.p('<SCRIPT LANGUAGE="JavaScript">');
    htp.p('<!-- Comment out script for old browsers');
    htp.p('function Close_List(val, idx_form, idx_fld)');
    htp.p('{');
    htp.p('window.opener.document.forms[idx_form].elements[idx_fld].value = val;');
    htp.p('self.close();');
    htp.p('}');
    htp.p('//-->');
    htp.p('</SCRIPT>');
    htp.HEADCLOSE;
    htp.BODYOPEN;
    if cmd_qry is null then
    s1 := 'SELECT a.'||master_fld||', a.'||show_fld||' FROM '||ownr||'.'||tbl_Name||
    ' a ORDER BY a.'||show_fld;
    else
    var_cmd := UPPER(cmd_qry);
    s1 := 'SELECT a.'||master_fld||', a.'||show_fld||' FROM '||ownr||'.'||tbl_Name||
    ' a WHERE UPPER(a.'||show_fld||') LIKE ''%'||var_cmd||'%'' ORDER BY a.'||show_fld;
    end if;
    i := 1;
    OPEN c FOR s1;
    LOOP
    FETCH c INTO var_mfld, var_sfld;
    IF c%FOUND THEN
    IF i >= pg.StartRec AND i <= pg.EndRec THEN
    odkaz :=''||var_sfld||'';
    htp.p(i||': '||odkaz||' ('||var_mfld||')<BR>');
    ELSE
         IF i > pg.EndRec THEN
         EXIT;
         END IF;          
    END IF;
    ELSE
    EXIT;
    END IF;
    i := i + 1;
    END LOOP;
    htp.p('<BR><B><INPUT TYPE=BUTTON ONCLICK="javascript:self.close();" VALUE="Close"></B><BR><BR>');
    CLOSE c;
    htp.BODYCLOSE;
    htp.HTMLCLOSE;
    end;

    If this makes any difference: Instead of using "var w = open..." try "var w = window.open..."

Maybe you are looking for