Multiple Forms for the Same Table

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
pdweinberg
Posts: 9
Joined: 2015-02-04 19:54

Multiple Forms for the Same Table

Post by pdweinberg » 2015-02-04 20:24

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?

User avatar
a.gneady
Site Admin
Posts: 1021
Joined: 2012-09-27 14:46
Contact:

Re: Multiple Forms for the Same Table

Post by a.gneady » 2015-02-05 23:35

This is unfortunately not directly supported in AppGini but can be implemented using hooks (see: http://bigprof.com/appgini/help/advance ... ific-hooks )
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

:arrow: Mass Update plugin: Update multiple records at once and improve your workflow efficiency.

:arrow: Summary Reports plugin: Build powerful reports and charts for your AppGini apps.

:arrow: Search Page Maker: Compose user-friendly yet powerful search pages for your AppGini apps.

User avatar
urichard
Posts: 16
Joined: 2018-11-01 12:11

Re: Multiple Forms for the Same Table

Post by urichard » 2018-11-03 12:29

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
richardaslabbert@gmail.com[/color]

Kind Regards
Richard

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 218
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Multiple Forms for the Same Table

Post by jsetzer » 2018-11-03 12:52

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

User avatar
urichard
Posts: 16
Joined: 2018-11-01 12:11

Re: Multiple Forms for the Same Table

Post by urichard » 2018-11-03 12:56

Hi Jsetzer...

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

Regards
Richard
richardaslabbert@gmail.com[/color]

Kind Regards
Richard

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 218
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Multiple Forms for the Same Table

Post by jsetzer » 2018-11-03 13:07

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

Post Reply