Help needed - A Matrix of Property/value pairs

Discussion in 'Javascript' started by Kenneth, Aug 11, 2003.

  1. Kenneth

    Kenneth Guest


    This is quite a tough one..

    First of all, I want to point out that I have posted this message to two
    other groups (microsoft.public.dotnet.framework.aspnet and
    microsoft.public.inetserver.asp.general), I wasn't able to do multi post to
    those 2 groups as well as this one as I can only get to the ms groups via
    their server.

    I came across the need of creating a matrix of property value pairs to
    manipulate some information stored in the database. The property fields will
    be limited via a dropdown, and the value will be free text. Each row can
    have different number of property/value pairs and we can have unlimited
    number or rows, as illustrated below:

    [cboRow1_P_1][txtRow1_V_1] [cboRow1_P_2][txtRow1_V_2]
    [cboRow1_P_3][txtRow1_V_3]....[cboRow1_P_N][txtRow1_V_N] [+][-]
    [cboRow2_P_2][txtRow2_V_2]......[cboRow2_P_N][txtRow2_V_N] [+][-]
    ..[cboRowN_P_1][txtRowN_V_1]......[cboRowN_P_N][txtRowN_V_N] [+][-]
    [New row] [Remove last row]

    [cboRow1_P_3][txtRow1_V_3] = The third property/value for the first Row in
    the matrix.
    [+][-] are buttons which add or remove a property/value pair for current
    [New row] [Remove last row] are buttons which add a new row to the end of
    the matrix, or remove the last row in the matrix

    I can achieve this no problem via server side scripts in asp ( not,
    unfortunately it generates many postbacks as posting back is the only way I
    can keep track of the number of rows and the number of pairs in each row.
    After I finish setting the property value pairs, I submit the page onto
    another asp page which will read through the matrix and apply some business
    logics to some table in the database according to the matrix, then store the
    matrix onto a table so it can be retrieved next time round. This worked well
    except that the number of post backs is causing severe decrease in
    performance, so, I'm looking at a rework of this app and keep the trackings
    on the client rather than posting back to the server. I know client side
    JavaScript is the way to go, but I do not have much experience with client
    side JavaScript, so I'm not making too much progress atm.

    Any ideas on how to tackle this (either via ASP or with client
    script will be greatly appreciated.
    my main concerns are:
    1. If I create controls dynamically on the client, How do I keep track of
    them during/between post back ( when I actually need to process the matrix
    and save it to the database for retrieval later.)
    2. currently I can only add a row to the end or remove the last row from the
    matrix. it would be nice if I can insert a row in the middle or at least
    remove a row from the middle of the matrix.

    Thank you for taking the time to read this long message.
    All comments are welcome and any input will be greatly appreciated.

    Kenneth, Aug 11, 2003
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Barrows
    Bob Barrows
    Aug 11, 2003
  2. lvcargnini

    Matrix composed by two matrix

    lvcargnini, Jul 4, 2006, in forum: VHDL
    Jonathan Bromley
    Jul 5, 2006
  3. Holgerson

    Matrix*Vector and Vector*Matrix

    Holgerson, Oct 25, 2007, in forum: C++
    Oct 26, 2007
  4. Antonio Quinonez
    Antonio Quinonez
    Aug 14, 2003
  5. aekalman
    Ben Morrow
    Nov 22, 2004

Share This Page