This topic is locked

Base Details dropdown from Master Table Selection

9/30/2014 12:23:32 PM
PHPRunner General questions
M
mid3vil author

I have a details page linked to my master table. On my edit/add pages I would like to be able to filter options in a drop down in my details section based on my master
EG: In master table I select Honda, then in displayDetailtable_Cars I want a dropdown selection of only Honda cars (Accord, Civic, ect)

If i change my master selection to Toyota, I would like to be able to select only (Camry, Corola, Tundra, etc)
Any pointers on how to do this?
Thanks

romaldus 10/6/2014

It's a basic feature but not possible in phprunner. Manual coding required.

M
mid3vil author 10/6/2014



It's a basic feature but not possible in phprunner. Manual coding required.


Thanks for the update, I may just do a work around by having an add page without child objects, then after record added redirect to edit page.

HJB 10/7/2014

Some logical basics behind CHAINED DROP DOWN issues by forum admin can be heard and viewed under:
http://www.xlinesoft.com/tutorials/MultipleDropdowns.html

M
mid3vil author 10/8/2014



Some logical basics behind CHAINED DROP DOWN issues by forum admin can be heard and viewed under:
http://www.xlinesoft.com/tutorials/MultipleDropdowns.html


Thanks for the information. Chained drop downs are one thing, but when that dropdown list is in a child record attached to a parent record things get quirky.

admin 10/8/2014

This is in fact quite simple.

  1. When you enter the child table page (Add page for instance) read the value of field from the master table and save it in some session variable. You can use event like Add page: BeforeProcess for this purpose.

$data = $pageObject->getMasterRecord();

$_SESSION["some_var"]=$data["FieldNameFromMasterTable"];


More info:

http://xlinesoft.com/phprunner/docs/getmasterrecord.htm
2. Then create a WHERE clause for your dropdown box referring to that session variable

"Make='".$_SESSION["some_var"]."'"