Page 1 of 1

Parent Filter - Dropdown blank in Grid Add (v12)

Posted: Sat Feb 13, 2016 3:14 am
by super20g

I am using 12.0.6

I have a dropdown that is filtered based on another field.

On the add page (one record at a time) the dropdown is populated and filtered correctly based on another dropdown field's value.

On the Grid Add page, the dropdown is empty when it should be populated based on another dropdown field's value....

What could I be doing wrong where the Add page is working correctly and this dropdown is not working at all on the Grid-Add page?


Parent Filter - Dropdown blank in Grid Add

Posted: Mon Feb 15, 2016 8:45 pm
by mobhar

Please try simulate/reproduce using the following .sql files below.

SET FOREIGN_KEY_CHECKS=0;


-- Table structure for table1


DROP TABLE IF EXISTS table1;
CREATE TABLE table1 (
Table1_Code char(3) NOT NULL,
Description varchar(50) DEFAULT NULL,
PRIMARY KEY (Table1_Code)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


-- Records of table1


INSERT INTO table1 VALUES ('001', 'Table1-001');
INSERT INTO table1 VALUES ('002', 'Table1-002');
INSERT INTO table1 VALUES ('003', 'Table1-003');


-- Table structure for table2


DROP TABLE IF EXISTS table2;
CREATE TABLE table2 (
Table1_Code char(3) NOT NULL,
Table2_Code char(3) NOT NULL,
Description varchar(100) DEFAULT NULL,
PRIMARY KEY (Table1_Code,Table2_Code)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


-- Records of table2


INSERT INTO table2 VALUES ('001', '001', 'Table2-001 < Table1-001');
INSERT INTO table2 VALUES ('001', '002', 'Table2-002 < Table1-001');
INSERT INTO table2 VALUES ('001', '003', 'Table2-003 < Table1-001');
INSERT INTO table2 VALUES ('002', '004', 'Table2-001 < Table1-002');
INSERT INTO table2 VALUES ('002', '005', 'Table2-002 < Table1-002');
INSERT INTO table2 VALUES ('002', '006', 'Table2-003 < Table1-002');
INSERT INTO table2 VALUES ('003', '007', 'Table2-001 < Table1-003');
INSERT INTO table2 VALUES ('003', '008', 'Table2-002 < Table1-003');
INSERT INTO table2 VALUES ('003', '009', 'Table2-003 < Table1-003');


-- Table structure for table3


DROP TABLE IF EXISTS table3;
CREATE TABLE table3 (
Table1_Code char(3) NOT NULL,
Table2_Code char(3) NOT NULL,
Table3_Code char(3) NOT NULL,
Description varchar(200) DEFAULT NULL,
PRIMARY KEY (Table1_Code,Table2_Code,Table3_Code)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


-- Records of table3


INSERT INTO table3 VALUES ('001', '001', '001', 'Table3-001 < Table2-001 < Table1-001');
INSERT INTO table3 VALUES ('001', '001', '002', 'Table3-002 < Table2-001 < Table1-001');
INSERT INTO table3 VALUES ('001', '001', '003', 'Table3-003 < Table2-001 < Table1-001');
INSERT INTO table3 VALUES ('001', '002', '004', 'Table3-001 < Table2-002 < Table1-001');
INSERT INTO table3 VALUES ('001', '002', '005', 'Table3-002 < Table2-002 < Table1-001');
INSERT INTO table3 VALUES ('001', '002', '006', 'Table3-003 < Table2-002 < Table1-001');
INSERT INTO table3 VALUES ('001', '003', '007', 'Table3-001 < Table2-003 < Table1-001');
INSERT INTO table3 VALUES ('001', '003', '008', 'Table3-002 < Table2-003 < Table1-001');
INSERT INTO table3 VALUES ('001', '003', '009', 'Table3-003 < Table2-003 < Table1-001');
INSERT INTO table3 VALUES ('002', '004', '010', 'Table3-001 < Table2-001 < Table1-002');
INSERT INTO table3 VALUES ('002', '004', '011', 'Table3-002 < Table2-001 < Table1-002');
INSERT INTO table3 VALUES ('002', '004', '012', 'Table3-003 < Table2-001 < Table1-002');
INSERT INTO table3 VALUES ('002', '005', '013', 'Table3-001 < Table2-002 < Table1-002');
INSERT INTO table3 VALUES ('002', '005', '014', 'Table3-002 < Table2-002 < Table1-002');
INSERT INTO table3 VALUES ('002', '005', '015', 'Table3-003 < Table2-002 < Table1-002');
INSERT INTO table3 VALUES ('002', '006', '016', 'Table3-001 < Table2-003 < Table1-002');
INSERT INTO table3 VALUES ('002', '006', '017', 'Table3-002 < Table2-003 < Table1-002');
INSERT INTO table3 VALUES ('002', '006', '018', 'Table3-003 < Table2-003 < Table1-002');
INSERT INTO table3 VALUES ('003', '007', '019', 'Table3-001 < Table2-001 < Table1-003');
INSERT INTO table3 VALUES ('003', '007', '020', 'Table3-002 < Table2-001 < Table1-003');
INSERT INTO table3 VALUES ('003', '007', '021', 'Table3-003 < Table2-001 < Table1-003');
INSERT INTO table3 VALUES ('003', '008', '022', 'Table3-001 < Table2-002 < Table1-003');
INSERT INTO table3 VALUES ('003', '008', '023', 'Table3-002 < Table2-002 < Table1-003');
INSERT INTO table3 VALUES ('003', '008', '024', 'Table3-003 < Table2-002 < Table1-003');
INSERT INTO table3 VALUES ('003', '009', '025', 'Table3-001 < Table2-003 < Table1-003');
INSERT INTO table3 VALUES ('003', '009', '026', 'Table3-002 < Table2-003 < Table1-003');
INSERT INTO table3 VALUES ('003', '009', '027', 'Table3-003 < Table2-003 < Table1-003');

  1. Make sure you have already enabled "Grid Add" from "Table" setup of "table3"

  2. Lookup Table settings for "Table1_Code" field of "table3":

  3. Table name: "table1"

  4. Link field: "Table1_Code"

  5. Display field #1: "Description"

  6. Lookup Table settings for "Table2_Code" field of "table3":

  7. Table name: "table2"

  8. Link field: "Table2_Code"

  9. Display field #1: "Description"

  10. Parent field: "Table1_Code"

  11. Filter field: "Table1_Code"

  12. Regenerate ALL the script files.

  13. Try to add a single record using "Add Page", the dynamic selection list is working properly. When you are selecting "Table 1 Code", then the data in "Table 2 Code" field will be populated based on the selected item in "Table 1 Code".

  14. Try also to add multiple records using "Grid Add Page", the dynamic selection list is NOT WORKING. When you are selecting "Table 1 Code", then the data in "Table 2 Code" field WILL NOT be populated based on the selected item in "Table 1 Code".


Re: Parent Filter - Dropdown blank in Grid Add but not in Ad

Posted: Thu Feb 25, 2016 12:47 pm
by Webmaster

If you are a registered user you can send your project files to support for testing:
http://www.hkvstore.com/phpmaker/support.asp


Re: Parent Filter - Dropdown blank in Grid Add but not in Ad

Posted: Fri Feb 26, 2016 1:25 am
by super20g

Thank you, I sent an email with the .pmp, sql dump of 100 records per table, license information, etc.


Re: Parent Filter - Dropdown blank in Grid Add but not in Ad

Posted: Fri Feb 26, 2016 1:05 pm
by mobhar

Thanks to Support. I got the response as follows:

------ begin of response -------
The problem was due to the fields are primary keys which are not updatable in Edit mode.
The parent/filter field info was not generated properly in JavaScript which is used for both Add and Edit mode.
We need a little more testing to make sure changes will not affect the Edit mode and we'll fix this in next build.

For the time being, you can use Client Script for List page to add back the missing parent/filter field info, e.g.
ftable3list.Lists["x_Table2_Code"].ParentFields = ["x_Table1_Code"];
ftable3list.Lists["x_Table2_Code"].FilterFields = ["x_Table1_Code"];

Alternatively, do not use primary keys in Dynamic Selection Lists.

Regards,
PHP Support
------ end of response -------


Re: Parent Filter - Dropdown blank in Grid Add but not in Ad

Posted: Wed Mar 23, 2016 11:45 am
by mobhar

This issue has been resolved in v12.0.7. Thank you!


Re: Parent Filter - Dropdown blank in Grid Add but not in Ad

Posted: Tue May 03, 2016 2:16 am
by super20g

Verified on my end as well... Thanks!


Re: Parent Filter - Dropdown blank in Grid Add but not in Ad

Posted: Wed Feb 08, 2017 11:36 pm
by elio42

Hi
I have the same problem. When v12.0.7. Will be released?