Hi!
I have asked this question earlier. But maybe people weren't clear about what I wanted to do. Hence I sending it agian. I really need to get this going asap. Sorry for the long question. But I need to get this done.
I am doing this in a jsp page:
Currently I am using the following for the expandable table logic:
<script language="javascript">
function sh(id)
{
var oObj = document.getElementById(id
)
if(!oObj) return;
oObj.style.display=(oObj.s
tyle.displ
ay=="none"
?"block":"
none");
}
</script>
<table border=1>
<tr onClick="sh('tr1')"><td>1<
/td><td>AB
C</td><td>
ABC is a name</td></tr>
<tr id="tr1" style="display:none;"><td>
</td><td colspan="2">
<table border=1>
<tr><td>1</td><td>A</td><t
d>A belongs to ABC</td></tr>
<tr><td>2</td><td>B</td><t
d>B belongs to ABC</td></tr>
<tr><td>3</td><td>C</td><t
d>C belongs to ABC</td></tr>
</table>
</td></tr>
<tr onClick="sh('tr2')"><td>1<
/td><td>XY
Z</td><td>
XYZis a name</td></tr>
<tr id="tr2" style="display:none;"><td>
</td><td colspan="2">
<table border=1>
<tr><td>1</td><td>A</td><t
d>A belongs to XYZ</td></tr>
<tr><td>2</td><td>B</td><t
d>B belongs to XYZ</td></tr>
<tr><td>3</td><td>C</td><t
d>C belongs to XYZ</td></tr>
</table>
</td></tr>
</table>
Firstly I want to provide a delete link next to each row when the tables are hidden and shown as rows and also I want to add another table instance or delete the table based on the users choice when he clicks the add button (to be provided at the bottom of the page) or delete link (as mentioned in my statement above) respectively.
Like a shopping cart.
Actually I am talking about entire tables to be added or deleted and also shown or hidden :
eg:
initially the table is shown with all its fields empty.
then once you fill the fields and click the add button then it shows only some of the fields of the table and also a delete order option such as
order# code# description
1 2wdeg this is going to be used in the 3e44rt model delete order
and also a another empty table as before, so that a user can fill in info for the new order and if he wants can click add or submit.
if add is clicked then it shows only some of the fields of the table and also a delete order option such as
order# code# description
1 2wdeg this is going to be used in the 3e44rt model delete order
2 77yytg this is a attachment to the series ty77 delete order
and also a another empty table as before, so that a user can fill in info for the new order and if he wants can click add or submit.
I am using JSP for all this with Jscript to control the show/hide table, as shown above.
guess the following is the way i am planning to implement it:
Scenario:
======
My page consists of 2 jsp's. Each having a java a single object in which various fields are contained.
jsp page one --> contains 1 java object (say user_info_object)
jsp page two --> (this page is included in the page one , using jsp page include) contains another java object (say order_info_object)
The java objects between both these pages need to communicate, as in if someone fills a value in userid (which is a field in the 1st java object, in the 1st jsp page) the order_info_obj's fields corresponding to that user id should be populated on the page.
All this info' is in extension to my question mentioned above.
I was planning to use vectors. Please do let me know if anyone has done anything similar to this.
-- Any help would be apreciated --