Hi,

 

Dbforms is a great tool!  I added rudimentary foreign key support to the single view and the list view.

Also added is parent child support.

Attached are the xsl files to auto gen these.  It is my hope that these are cleaned up and added to the list.

 

Important note:  This was my first time programming XSLT's so it is not pretty.  HOWEVER, the whitespace

(or lack thereof) will make or break the app.  I suggest you get them working "as is" before trying to clean them up.

 

There are two kinds of links generated on the single forms.  The first kind of link is generated by a foreign

 key; it goes to a single page of the appropriate object.  The second kind of link is generated by comparing

the primary key name to field names in other tables.  If they are the same, a link is generated to a list page.

This models a "has-a" or child relationship.  If you are on a parent table, there will be links to all the children.

If foreign keys are correct in the dbforms-config file, all the children will point to their parent.

 

Bugs? Lots!  A drop down table looks like a parent to many tables.  The layout is crude.  Only simple keys work (and I use the "defaultVisibleFields"  in places instead of the key (they are the same for the auto gen'd

Config file)).  Not all of the foreign key spec is used (only the minimal, actually).  I am confident there

Are more bugs.

 

BUGFIX To make the list pages links work add:

 

            <events>

                  <navigation-events>

                        <navigation-event type="navGoto" className="org.dbforms.event.datalist.GotoEvent" />

                  </navigation-events>

            </events>

To the bottom of dbforms-config.xml.  This fix is independent of the code I released.

 

I figured this was useful code to me and others might be able to use it too.  Early and often code releases...

 

I hope you like this as much as much as I like dbforms,

Albert S. Boyers

 

 

 

Attachment: generate_singleforms.xsl
Description: Binary data

Attachment: generate_lists.xsl
Description: Binary data

Reply via email to