Metadata in tabs?

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
dge
Posts: 25
Joined: 2013-12-05 02:54

Metadata in tabs?

Post by dge » 2023-01-27 02:13

Code examples from the appginiHelper website indicate it's possible to show Metadata in a tab but I can't get it to work. Using the latest appgini (22.14) and latest appgini helper version, I can create a tab called Metadata but it won't show anything in that tab (though my other tabs work fine). It would be very useful to be able to see the creator, modifier and modification date like the examples show!

This is my code:
var dv = AppGiniHelper.DV;
dv.compact();

dv.getField("quantity").size(100);
dv.getField("displayOrder").size(70);
dv.getField("priceCharged").size(100);
dv.getField("quantityShipped").size(150);

var row_1 = dv.addLayout([2,8,2])
.add(1, ["prodPhoto","displayOrder", "backorder","odHide"])
.add(2, ["productFamily", "productType", "prodID", "custom", "odDescription", "productNote", "odNotes"])
.add(3, ["quantity", "listPrice", "copyFunction", "priceCharged", "unitsInStock", "quantityShipped" ])
.wrapLabels();

var row_2 = dv.addLayout([6,6])
.add(1, ["invoiceDate", "orderID", "productBOMKey"])
.add(2, ["invoiceNumber","extPrice", "odID"])
.wrapLabels();

var tab1 = dv.addTab( "Item Info", "Item Info", "Item Info" )
.add(row_1);

var tab2 = dv.addTab( "Utility", "Utility", "Utility")
.add(row_2);

var tab3 = dv.addTab( "meta-tab", "Metadata", "cog" )
.add(["created_by", "modified_by", "modified_on"]);

dv.getTabs().setPosition(TabPosition.Bottom);

The Item Info and Utility tabs contents work as expected but the Metadata tab is empty, it shows nothing.
The console shows these errors: AppGiniHelper Field not found: #created_by, and also Field not found for #modified_by and #modified_on

My code is based on the examples found here: https://appgini.bizzworxx.de/products/j ... view/tabs/
It would be very useful to be able to see the metadata. What am I doing wrong?

Image

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

Re: Metadata in tabs?

Post by jsetzer » 2023-01-27 07:22

The console shows these errors: AppGiniHelper Field not found: #created_by, and also Field not found for #modified_by and #modified_on
The error messages exactly tell us that your table does not have those fields.


---

This tab you have seen is just a normal custom tab, labelled "Meta" (or "Metadata" if you like). Just create it as always and insert your table's fields, for example id, created_by, created_on etc.. nothing special. Ensure your table contains the fields/fieldnames you are using here.

Remember:
This is a (clientside) Javascript Library. We can only show data we already have on clientside.

The library does not fetch any additional schema information from the database nor from additional membership_* tables nor from any serverside APIs. If you need additional data on clientside you have to fetch that data using AJAX, for example.

Tip
I got used to create the following fields on all tables:
  • id (obviously)
  • created_on
  • created_by
  • modified_on
  • modified_by
This makes it easy for me to kind of auto create a tabMeta in all DVs. The function for creating that tab is in header-extras, so I don't even have to write such code in every DV.

So, sorry, nothing fancy out of the box but just well known AGH Javascript Library functions for custom tabs.

Docs for custom tabs
http://www.appgini.de/docs/Javascript-L ... index.html
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

dge
Posts: 25
Joined: 2013-12-05 02:54

Re: Metadata in tabs?

Post by dge » 2023-01-27 17:43

Thanks Jan! Makes perfect sense, somehow I was under the impression it was able to (magically) access the membership tables, but of course javascript can't do that. Maybe adding a little note into the your documentation to remind people of that would be helpful as well.

Post Reply