Page 1 of 1

Multiple Forms for the Same Table

Posted: 2015-02-04 20:24
by pdweinberg
Rather than creating multiple tables in my application, I want to use a single generic table to hold all records. There will be a Parent Table that will contain only only 1 field - a Category field that will be a dropdown list containing for example "Cars, Planes, Bikes, Boats'. The Child table will also have a Category field (to provide the linkage), and the other data fields will be called Field1, Field2, Field3 etc. If a user selects 'Cars' from the Parent Table, and 'New' in the Child table, it will autopopulate the Category field in the Child table with 'Cars'. Now comes the issue. I want the captions in the Detail form to be unique to the selection in the parent table. So for example, if 'Cars' is selected, Field1 would have a caption of 'Make', Field2 'Model', Field3 'Year' etc. If 'Planes' was selected, Field1 must have a caption of 'Type', Field2 'Propulsion System', field3 'Manufacturer'. The fields remain the same in all forms; it is just the captions that change. Any thoughts?

Re: Multiple Forms for the Same Table

Posted: 2015-02-05 23:35
by a.gneady
This is unfortunately not directly supported in AppGini but can be implemented using hooks (see: http://bigprof.com/appgini/help/advance ... ific-hooks )

Re: Multiple Forms for the Same Table

Posted: 2018-11-03 12:29
by urichard
Hi Admin

I have a simmilar question, and im not sure if its the same question as posted here but i want to have a single table hold all the records of multiple other tables for example the main table is called products and then there is 3 other tables that are linked as child tables and everytime there is a new record added , edited or deleted on these other 3 tables it will do the same to this main table?

PS sorry again for posting here as i dont know how to start my own question thread

Kind Regards
Richard

Re: Multiple Forms for the Same Table

Posted: 2018-11-03 12:52
by jsetzer
Hello @pdweinberg!
pdweinberg wrote:
2015-02-04 20:24
The fields remain the same in all forms; it is just the captions that change. Any thoughts?
As Ahmad already said, there is no built-in solution, but it IS possible to change the labels on the fly using JQuery and maybe one AJAX call + serverside PHP script. I did it in one of my projects which is described here: https://forums.appgini.com/phpbb/viewto ... 8934#p8550
In the 2nd and 3rd screenshot you can see that I have changed the labels on the fly depending on a dropdown-selection. It will also be possible to replace the labels' content depending on some kind of "type_id" value according to string values from another database table for example.

You can send me a PM, If you need further support.

Regards,
Jan

Re: Multiple Forms for the Same Table

Posted: 2018-11-03 12:56
by urichard
Hi Jsetzer...

Was that meant for me or pdweinberg as the msg thread is from 2015?

Regards
Richard

Re: Multiple Forms for the Same Table

Posted: 2018-11-03 13:07
by jsetzer
Hello @urichard,

my post is an answer to pdweinberg's question as I have written in the first line:
Hello @pdweinberg!
Maybe it helps someone.


Concerning your question:
As far as I can see, your question is something completely different. Yes, you can write code after insert/update of your child-tables to modify the related master-record. Using includes there will be only very little code per child-table.

Regards,
Jan