Velocity Reviews > Help needed - A Matrix of Property/value pairs

# Help needed - A Matrix of Property/value pairs

Kenneth
Guest
Posts: n/a

 08-11-2003
Hello,

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_1][txtRow2_V_1]
[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
row.
[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 asp.net),
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 ASP.net) 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

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Terry Reedy Python 0 04-02-2009 12:12 AM Holgerson C++ 3 10-26-2007 07:38 AM lvcargnini VHDL 3 07-05-2006 07:21 AM Bob Barrows ASP .Net 2 08-11-2003 01:16 PM PeterTHX DVD Video 0 08-03-2003 05:46 AM