CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 variable forms on editable grids

Print topic Send  topic

Author Message
greywire


Posts: 37
Posted: 03/08/2004, 5:24 PM

Hope I can explain clearly what I want to do here.

I need an editable grid where the forms can be different on each entry. I have a table that describes the types of data (ie, 'date', 'string', 'integer', 'enumeration', etc), and another that is the data. I want to list the data in the editable grid but have the forms change based on the data type. So one line might have a text box, another line might have a dropdown, another might have a text box that only accepts a number with validation, another could be a date pop up, etc. They all go into the same field, just different forms to make input easier.

I can't think of a way to get the editable grid to do this, short of completely customizing the generated code to the point where it could not be generated again.

Any ideas?
_________________
--
Aric Caley
Fonality, inc
View profile  Send private message
srinivas

Posts: 54
Posted: 03/31/2004, 12:44 AM

This is probably not a CLEAN way, but might work.

Create multiple controls for each of the field that you are interested in displaying the DATA. Have an event, probably BEFORE ROW SHOW, where you can write custom code to check and turen the each of the controls' visibility to TRUE or FALSE based on the data type. In the case of a LIST-BOX you can populate the LIST dynamically. In essense, out of DATE, TEXTBOX, LISTBOX controls you create for each field - you set the VISIBILITY of of JUST ONE of them to TRUE and set the visibility of others to FALSE.

Hope that helps.

-Srinivas
View profile  Send private message
greywire


Posts: 37
Posted: 03/31/2004, 11:28 AM

That is essentialy what I've done.

What needs to be done is this:

You need to have in your SELECT statement a field that indicates what type of data each field is. I have a table of field types I do a join on.

Then, in your before show row you can do a switch on that type, and enable/disable the controls as needed. NOTE: I found that setting the Visible property for each control did not work unless you added BEGIN and END block markers around the control in the HTML. For example:

<!-- BEGIN TextBox data_zip -->
<!-- END TextBox data_zip -->

The last part ("data_zip") needs to be the name of the control inside, and the other part is the type of control.

You need to have a hidden control that contains this field type, so that when it is submitted you can check which type you have.

Finaly, you need a before execute update function. Here you will swtich on that hidden field type control, and this will determine which control you need to grab data from. I used my own SQL insert, but if you use the one in CC choose one control and copy your data into that one.

Hope that helps if anyone else needs to do this. Its pretty simple but lets me create a completely custom, dynamic form! In my application the user can create any number of fields and have a simple form with all of them.


_________________
--
Aric Caley
Fonality, inc
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.