well .. i am gonna give this a try. But this is off the top of my head. Do
assume some syntax errors :)

<!--- DataEntry.jsp -->
        <script language="javascript"
                  src="/scripts/js/customer.js">
        </script>
        <form name="frm_data" ...>
                <input type=text
                         name="customer_id"
                ..>
                <input type=button
                         onClick="show_lov()"
                ... >
                <!-- etc...etc -->
        </form>
<!--- DataEntry.jsp ends -->


<!--- Customer List of Values File (cust_lov.jsp) -->
<!--
        u can have variety here .. list/checkbox/etc .. i am
        making it simpler .. this will be generated output of
        the JSP.
-->
        <script language="javascript"
                  src="/scripts/js/customer.js">
        </script>
        <form name="frm_list">
        <select name="customer_id">
                <option value="c1">Customer 1</option>
                <option value="c2">Customer 2</option>
                <option value="c3">Customer 3</option>
                <option value="c4">Customer 4</option>
                <!-- and more -->
        </select>
        <input type="button"
                 value="select"
               onClick="update_parent()" >
        </form>
<!--- Customer List of Values File (cust_lov.jsp) ends -->

<!-- /scripts/js/customer.js -->

        //function to display List of Values (LOV)
        //called by -> DataEntry.jsp
        //
        function show_lov() {
                var w1 = window.open("cust_lov.jsp","","height=300,
width=500,toolbar=no");
                //anything else u would like
        }

        //function to update the parent window with the selection
        //called by -> cust_lov.jsp
        //
        function update_parent() {
                var sel_cust_id;
                sel_cust_id = document.frm_list.customer_id.value;
                window.parent.document.frm_data.customer_id.value = sel_cust_id;

                //and now close the current window
                window.close();
        }

<!-- /scripts/js/customer.js ends -->

The solution discussed above does not account for things like Browser
differences, etc (which are the cause of most headaches - as far as i am
concerned). U could find the code above in almost any webmail service that
allows a popup address book.

I hope this helps :) As i said before -- this is off the top of my head --
expect syntax errors ;)


Mayuresh Kadu
Pune, Maharashtra, India


-----Original Message-----

We are developing a Web based Application using JSP.
In an Data Entry Form to accept data into a table, we
would like to give the option to the user to select the required value
from a pop up window which will display all the columns of the related
table.
Eg: To enter the value of the field Customer Code, the user should be able
to
select the appropriate code from the pop window which will show up when the
user clicks on a button beside the entry field . It will contain all the
columns of the table
Customer master. so the user can browse thru it and select the code based on
the
Customer Name.
Would Appreciate help on the above.
Rgds
JOE

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to