This topic is locked

Dependent Drop downs problem

1/14/2010 7:31:45 AM
PHPRunner General questions
M
marke author

Jane
I have a lookup wizard similar problem - (I have already checked "Search and sorting of lookup Values")
My query is:

SELECT

`tblinput`.`idinput`,

`tblinput`.`simulationid`,

`tblinput`.`name` AS `name`,

`tblinput`.`type`,

`tblinput`.`description` AS `description`,

`tblinput`.`fileid`,

`tblinput`.`componentid`,

`tblinput`.`couplingtype`,

`tblinput`.`couplingfrequency`,

`tblinput`.`couplingfrequencytype`,

`tblinput`.`spatialregrid`,

`tblinput`.`spatialregridtype`,

`tblinput`.`timeregrid`,

`tblinput`.`updateDate` AS `updateDate`,

`tblinput`.`updateBy` AS `updateBy`,

`tblinput`.`modelid` AS `modelid`,

`tblactivity`.`shortname` AS `activityname`,

`tblactivity`.`idtblactivity` AS `activity`

FROM `tblinput`

INNER JOIN `tblsimulation` ON `tblinput`.`simulationid` = `tblsimulation`.`idtblsimulation`

INNER JOIN `tblexperiment` ON `tblsimulation`.`experimentid` = `tblexperiment`.`idexperiment`

INNER JOIN `tblactivity` ON `tblexperiment`.`activityid` = `tblactivity`.`idtblactivity`

ORDER BY `tblinput`.`simulationid`, `tblinput`.`name`


The query works fine. I have selected all fields to be available in Add and Edit
I want to use tblactivity.idtblactivity to be the category control in a dependent dropdown BUT the fields from joined tables are not available as a category control. This does work if I use a non-joined field as the category control - but for this case I need to use a joined field.
So then I tried an alternative solution modifying the WHERE clause on the dropdown definition directly:
"idtblactivity = '".$values["activity"]."'"
idtblactivity is the field in the table being used for the lookup, and I was hoping that $values['activity'] would hold the value I needed from the query above. But this doesn't work either (reports: undefined variable: values in tblinput_settings.php)
Is it a limitation of PHPRunner that I can't use joined variables as a category control in dependent dropdown - the preferred solution. If so is there another work around I can use.
thanks
Mark

J
Jane 1/15/2010

Mark,
unfortunately PHPRunner doesn't support joined fields as category field/category control.

As workaround you can create view in the database and then use this view as lookup table on the Edit as settings dialog.
Here is a helpful link:

http://dev.mysql.com/doc/refman/5.0/en/show-create-view.h