R
Rob Meade
Hi all,
I've got myself into a bit of a problem and I'm trying to dig my way back
out, in a) the quickest way due to project deadline and also b) best
approach.
I have a form which gets a set of document type properties from SQL Server,
these properties are used to create corresponding controls on the form, so
for example:
PropertyDisplayName : Surname
PropertyObjectName : txtSurname
In this very small example the "Surname" text would be displayed on the left
of the text box which would have the ID of "txtSurname".
There are currently 6 different document types - each with a set of
properties, some of the properties are common in each document type (like
surname for example).
My problem is that if my querystring does not contain the 'document type' I
dont know what type of form to give the user - therefore the form has a drop
down menu with all of the document types listed for them to select from -
this only appears if the querystring value is missing, if it is present,
then the drop down is replaced with a readonly text box with the name of the
document type in it.
What I need to do in the case of the querystring not containing a value for
the document type would be to change the controls on the form. This needs
to be achieve without a reload of the page.
Initially I was thinking that I could get all of the document types and
associated properties from the database in one go at the beginning, put each
document type into a seperate 'panel' and then show/hide the relevant
panel - my only probelm with this (untested) is that I also have validation
controls for each dynamically created control - the names for these are also
taken from the database - ie txtSurname would have the first 3 characters
dropped and then have vld added - creating vldSurname, I can foresee if I go
down this route 6 panels all sharing at least 1 control which is the same
(lets say surname) - and therefore having 6 txtSuranmes and 6 vldSurnames -
surely this will cause some form of problem as the names wont be unique.
My next thought was perhaps to create the one display with all of the
properties on it regardless of which document type they belong to and set
them all to visible = false at the start - then if they are needed by the
document type change their visible status to true. My question here is
whether or not if you set a control to visible = false whether it still gets
submitted when the form is submitted?
Any information or suggestions on this would be appreciated - if I had more
time for this I may go back and change somethings which may remove this
issue - however time has nearly run out so I need a 'best solution for now'
kinda approach.
Regards
Rob
I've got myself into a bit of a problem and I'm trying to dig my way back
out, in a) the quickest way due to project deadline and also b) best
approach.
I have a form which gets a set of document type properties from SQL Server,
these properties are used to create corresponding controls on the form, so
for example:
PropertyDisplayName : Surname
PropertyObjectName : txtSurname
In this very small example the "Surname" text would be displayed on the left
of the text box which would have the ID of "txtSurname".
There are currently 6 different document types - each with a set of
properties, some of the properties are common in each document type (like
surname for example).
My problem is that if my querystring does not contain the 'document type' I
dont know what type of form to give the user - therefore the form has a drop
down menu with all of the document types listed for them to select from -
this only appears if the querystring value is missing, if it is present,
then the drop down is replaced with a readonly text box with the name of the
document type in it.
What I need to do in the case of the querystring not containing a value for
the document type would be to change the controls on the form. This needs
to be achieve without a reload of the page.
Initially I was thinking that I could get all of the document types and
associated properties from the database in one go at the beginning, put each
document type into a seperate 'panel' and then show/hide the relevant
panel - my only probelm with this (untested) is that I also have validation
controls for each dynamically created control - the names for these are also
taken from the database - ie txtSurname would have the first 3 characters
dropped and then have vld added - creating vldSurname, I can foresee if I go
down this route 6 panels all sharing at least 1 control which is the same
(lets say surname) - and therefore having 6 txtSuranmes and 6 vldSurnames -
surely this will cause some form of problem as the names wont be unique.
My next thought was perhaps to create the one display with all of the
properties on it regardless of which document type they belong to and set
them all to visible = false at the start - then if they are needed by the
document type change their visible status to true. My question here is
whether or not if you set a control to visible = false whether it still gets
submitted when the form is submitted?
Any information or suggestions on this would be appreciated - if I had more
time for this I may go back and change somethings which may remove this
issue - however time has nearly run out so I need a 'best solution for now'
kinda approach.
Regards
Rob