This topic is locked

Dependent dropdown again

11/20/2006 11:21:12 AM
PHPRunner General questions
D
daniel author

Hello,
after working with PHPrunner for two days now, I am stuck with a problem:
I want to create a page for saving the results of an item inspection.

There are two tables with a master-detail-relationship: tbl_master and tbl_detail.

Fields are
tbl_master: master_id, itemgroup, item, quantity_items_checked
tbl_detail: master_id, detail_id, colour, quantity_colour.
Depending on item/ itemgroup a predefined set of colours can occur (lets say itemA: red, blue, green; itemB: red, blue, yellow, orange; ...). These dependencies are stored in
tbl_colour_item: item, colour.
After adding a new master-record (123, itemA, groupA, 20), the user should be transferred to a page, where he can type in the colour-quantities.

Example:
"itemA":
red:

blue:


green: ___
When clicking "Submit", every colour should be inserted as a new record in the detail-table.
So here are the things I can't get to work:

  1. Displaying the possible colours on the detail-page: I inserted a dropdown-box with the lookup wizzard but couldn't figure out how to configure the settings. The box only shows the first items colours, no matter what item I choose on the master table.
  2. Multiple records at one time: saving the detail-records on-by-one works fine. Is there any possibility to insert many records with clicking "Submit" only once?
    I searched the FAQ and the forum to find an answer, but the given hints didn't solve my problem. So any suggestion would be very nice.
    Thanks

    Daniel

J
Jane 11/21/2006

Daniel,
please see my answers below:

  1. you need to do the following:

  • add item field to the tbl_details table.
  • set up this field as dropdown box, select tbl_master in the Table, item in the Link field and Display field dropdown boxes on the "Edit as" settings dialog.
  • select Lookup wizard for the color field, select tbl_color_item in the Table, color in the Link field and Display field dropdown boxes on the "Edit as" settings dialog.

    Set up dependency between these fields: use item in both Category control and Category field dropdown boxes.

  1. unfortunately, you can't save more then one record on the ADD page at one time in PHPRunner.

D
daniel author 11/21/2006

OK, solved the first problem by inserting an OnLoad-Event on the detail-page (that gets the item_id from the mastertable) and adding a where-condition for the dropdown-box.
The second question remains the same. I read a thread saying, that it is impossible to edit multiple records at a time - is this true?