Help needed - A Matrix of Property/value pairs

K

Kenneth

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top