View Full Version : I've been DOMinated

11-08-2002, 07:05 PM
Now that I've gotten your attention, I really need some help here thinking about a solution to my problem. Every tack I take presents new and different problems to solve. How the client-side is solved affects the server-side so I'm dual-posting to the ASP forum. (http://codingforums.com/showthread.php?s=&postid=45355#post45355)

I've posted a previous thread (http://codingforums.com/showthread.php?s=&threadid=8202&highlight=window) on this issue, but I need to think about it differently somehow to find a solution, if there is one. I know what I want for a solution but that is looking like a dead end.

The big picture
I have a pretty big HTML page for data entry. I'm using ASP and SQL Server 7 on the back-end to store and retreive the data.

I have a data sub-set on this page (ie a M:1 relationship to the whole page) where want to dynamically create new data entry rows.

The sub-data is the key/crux/focal point of the problem. What kind of interface do I give the user to enter all the data? I'm obsessed with a "one HTML page" solution. But I've seen absolutely nothing in ASP or DHTML that supports data entry or data manipulation with a 1:m relationship. I believe a "one pager" is best for the user, but as I struggle with this, the light at the end of the tunnel is getting dimmer!

In a perfect world I want to have all my data visible and editable from this one page. This design should also facilite sending to the server when the user clicks SUBMIT so that ALL the data goes at once and then on the server I don't have to sort out data coming from different pages (which would presume a specific data entry order by the user!) to get everything tucked away in the DB and maintain data integrity. NOTE: I don't use, and don't know how to use ADO transactions, so I don't know if this could be part the overall solution.

My Current Path of Exploration
I open a child window. In this child window, using DOM I dynamically create HTML table rows, each row representing a data record wherein. This is working great. Now the sticky wicket is getting the data back on the parent page.

Technical Issues, Questions, and current expimental track
* From the child page I need to be able to "reach out and touch" the parent.

** Looks like I cannot reference my parent page using DOM, Yes? No?

** I thinking of building a javascript object out of the "DOMinized" table - a little coding, but doable. Now I have a structure that is referenceable using either DHTML or DOM... Then what?

** I have some challenges at this point.
......(1) Reproducing the data on the parent page.
..........(a) I've found no handy DHTML methods to help out. For example it's possible to build new <select> options with "new Option()", but there's no equivelant for creating <TD> or <TR> for a <table> - is there?
..........(b) The only thing I can think of is "window.opener.document.write..."
..............(i) now the challenge is getting the table in the desired spot on the parent page.
..........(c) Utilize Cookies?
..............(i) now the challenge is referening a cookie from the parent page that was written from the child page. I'm pretty darn sure it's possible, but I don't know how.

......(2) Assuming #1 is solvable in any way, how do I get the table in it's desired place on the page?
..........(a) Using the 1.b solution above I imagine the table showing up on the very bottom of the page, below my buttons and page footer. Not good.

Brain Storming
Would having this "sub-data" in a separate form help in any way? As this data is visually between other data elements on the page, now I'd have 3 forms - and some of my data going to the same DB table will be split between two forms.

Don't even have the data displayed on the parent page at all. Store the data from the child page in a cookie, and when the SUBMIT button on the parent page is clicked, the cookie is fetched, the data values are all put in simple (hidden) text boxes inside the <form> so they also go along for the ride to the server. OR maybe the cookie itself goes along as an ASP cookie collection - but it was not built by the parent! Is that a problem?

Chuck the whole thing and put in a fixed number of rows for data entry. That's too easy :)

***** added to original post ************

OH, I forgot...
Are a mix of DOM and DTHML referencing allowed on the same page? In other words could I simply port all the child-window code to the parent page? when I try to execute "addRow()" I get a "object expected " error. Keep in mind this code works fine as a stand-alone window/page:

function addRow(thisTable){
var tbody = document.getElementById(thisTable).getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
} // end of addRow()

. . .
. . .

<table name="DBReportsTable" id="DBReportsTable" cellspacing="0" border="1">
<td rowspan="2">Delete</td><th rowspan="2">Title</th>
<th colspan="4">Formats Available</th><th rowspan="2" colspan="2">Web Page</th>

<th>Not Avail</th><th>Printed</th>

<table id="controlPanel">
<td colspan="2" align="center">
<input type="button" name="delReport" id="delReportID"
value=" Delete " title="Checked Reports will be deleted"

<td colspan="2" align="center">
<input type="button" name="addReport" id="addReportID"
value=" Add Report " onclick="addRow('DBReportsTable');">

. . .
. . .
. . .

Whew! TIA
Daniel Boone
"Blazing new trails since 2001"

11-12-2002, 09:09 PM
Well, I can't comment on everything, but there is a separeate 'table object model' of sorts that empowers you to dynmically create tables...


As far as getting the data back to the parent...uhh. You need this data on the parent page for a form submission right?

11-12-2002, 09:18 PM
As far as getting the data back to the parent...uhh. You need this data on the parent page for a form submission right?