-
March 10th, 2023, 20:55 #1
Create new record with more then one class (fRecordDisplayClass)
Ok, here I am with something new to fix. Using fRecordDisplayClass I am able to define the
right class for a record. So my masterindex can show everything in one list, loading the right
class for each record.
What happens when I want to create a new record? How do I get the new record to be handled
by the class I want?
-
March 11th, 2023, 00:57 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,541
The masterindex class was built to show all of a single record type; not multiple record types in a single window. The master index class is only designed to automatically add/display one class at a time relevant to the record type it is showing.
Regards,
JPG
-
March 11th, 2023, 11:33 #3
Yes, and that's what I do, using 2 or more different display classes. The function defined by the fRecordDisplayClass
parameter takes care of returning the right class to use. Works well.
The Masterindex has a + button that allows you to create a new record, but I think it does it with the class defined
by the aRecordDisplayClasses parameter, so I was thinking if it was necessary to have a separate button for the
creation of each type of class, or if there was a parameter with which to define the right class to use also for the
creation of a new record.
-
March 11th, 2023, 21:11 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,541
You'd have to create your own button template to insert into the master index which adds a different setup.
There are a couple examples used by the "table" record type in CoreRPG:
aGMEditButtons = { "button_add_table_guided", "button_add_table_import_text" },
Then, you would have your button do the record add to the right location in the database, based on LibraryData.getRootMapping(sRecordType). That's how all the button templates work for adding records, including the default template (button_iadd_masterindex).
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks