rob
Administrator
Subtitle ... Whats the "Tables with database join elements linking to this table" all about?
This basically allows you to jump from one table to another table, filtering the data in the second table based on the row selected in the first table.
(this is presuming you are working form the latest version of the SVN, as parts of what I am describing have changed since the release of 1.0.4)
For my example I will have two tables; "countires" and "towns"
The following tutorial will explain how, for each country record, we can create a link that will point to the towns table only showing the country's towns.
heres the table structure for "counties"
and here's table the structure for "towns"
For the town's table, I want "country_id" to be a drop down of all the countries contained in the "countries" table. So we edit the "country_id" element and mak it into a database join element, with "countries" selected for drop down table, id" selected for "Table's Foreign Key Column" and "label" selected for the "Table's Foreign Value Column".
Having saved this element, we now go back to edit the "countries" table.
At the bottom of the data tab there is a section called "Tables with database join elements linking to this table".
As we have created a database join element in "towns" that points to the "countries" table there should be one row listed in this section:
selecting "yes" for the "link to table" option will create a new column in your table view (with the heading specified in the adjacent "label" field)
Each of rows in this column will contain a link which will direct you towards the "towns" table, but only show those towns within the country's row you came from
Likewise selecting "yes" for the "link to form" option will create a link (again with the heading specified in the adjacent "label" field) that will point you to the "towns" form, with the "country_id" drop down value selected as the country name the link was in.
Cheers
Rob
This basically allows you to jump from one table to another table, filtering the data in the second table based on the row selected in the first table.
(this is presuming you are working form the latest version of the SVN, as parts of what I am describing have changed since the release of 1.0.4)
For my example I will have two tables; "countires" and "towns"
The following tutorial will explain how, for each country record, we can create a link that will point to the towns table only showing the country's towns.
heres the table structure for "counties"
Code:
id int(11) pk
label varchar(255)
and here's table the structure for "towns"
Code:
id int(11) pk
country_id int(11)
label varchar(255)
For the town's table, I want "country_id" to be a drop down of all the countries contained in the "countries" table. So we edit the "country_id" element and mak it into a database join element, with "countries" selected for drop down table, id" selected for "Table's Foreign Key Column" and "label" selected for the "Table's Foreign Value Column".
Having saved this element, we now go back to edit the "countries" table.
At the bottom of the data tab there is a section called "Tables with database join elements linking to this table".
As we have created a database join element in "towns" that points to the "countries" table there should be one row listed in this section:
Code:
Table Link to table Label Link to form Label
towns No/Yes view towns No/yes view form
selecting "yes" for the "link to table" option will create a new column in your table view (with the heading specified in the adjacent "label" field)
Each of rows in this column will contain a link which will direct you towards the "towns" table, but only show those towns within the country's row you came from
Likewise selecting "yes" for the "link to form" option will create a link (again with the heading specified in the adjacent "label" field) that will point you to the "towns" form, with the "country_id" drop down value selected as the country name the link was in.
Cheers
Rob