Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy I've been DOMinated

    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.

    I've posted a previous thread 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
    Communication
    * 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?


    * NOW 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:

    Code:
      function addRow(thisTable){
        var tbody = document.getElementById(thisTable).getElementsByTagName("TBODY")[0];
        var row = document.createElement("TR");
        row.id="reportRow";
    ...
    } // end of addRow()
    
    . . .
    <body>
    <form>
    . . .
    
    <table name="DBReportsTable" id="DBReportsTable" cellspacing="0" border="1">
      <tbody>
        <tr>
           <td rowspan="2">Delete</td><th rowspan="2">Title</th>
           <th colspan="4">Formats Available</th><th rowspan="2" colspan="2">Web Page</th>
        </tr>
        
        <tr>
           <th>Not Avail</th><th>Printed</th>
           <th>Electronic</th><th>Web</th>
        </tr>
        
    </tbody>
    </table>
    <BR>
    <table id="controlPanel">
    <tbody>
    <tr>
        <td colspan="2" align="center">
            <input type="button" name="delReport" id="delReportID"
     value=" Delete " title="Checked Reports will be deleted"
     onclick="deleteRows('DBReportsTable');">
        </td>
        
        <td colspan="2" align="center">
            <input type="button" name="addReport" id="addReportID"
     value=" Add Report " onclick="addRow('DBReportsTable');">
        </td>
    </tr>
    </table>
    
    . . .
    </form>
    . . .
    </body>
    . . .
    </html>

    Whew! TIA
    Daniel Boone
    "Blazing new trails since 2001"
    Last edited by RadarBob; 11-08-2002 at 07:41 PM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I can't comment on everything, but there is a separeate 'table object model' of sorts that empowers you to dynmically create tables...

    http://msdn.microsoft.com/workshop/a...uildtables.asp
    http://www.mozilla.org/docs/dom/domr...12.html#998953

    As far as getting the data back to the parent...uhh. You need this data on the parent page for a form submission right?
    Last edited by beetle; 11-12-2002 at 08:11 PM.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As far as getting the data back to the parent...uhh. You need this data on the parent page for a form submission right?
    Yep.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •