Urgent please- Fields not showing in Add Mode.

Talk about foreign keys

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

daviddelmonte
Master
Master
Posts: 159
Joined: Feb 23rd, '10, 15:06

Urgent please- Fields not showing in Add Mode.

Postby daviddelmonte » Jun 29th, '10, 16:56

Not sure any more what to do..

I have three grids.

In my first, everything is nice. This refers to Photographs

Second page, this refers to Editions of the Photographs.

Problem starts in Add Mode.

If I already have some Editions, when I try to add another, I see the field "Photograph Name" show up fine.

If I do not have any "Editions", the "Photograph Name" does not appear. The Photograph Name is taken from the first grid.

I can see the Photograph name in the VM list.

Here is my code, and some screen shots.. I would appreciate any help.

I'm just showing the EM and FK columns for Photograph Name .

EM Column :

Code: Select all

"negative_id" =>array(
"header"=>"Photograph Title",
"type"=>"foreign_key",
"width"=>"210px",
"req_type"=>"st",
"title"=>"",
"readonly"=>"true",
),



FK Column:

Code: Select all

// PRINT TITLE

"negative_id"=>array(
"table"=>"negatives",
"field_key"=>"negative_id",
"field_name"=>"print_title",
"view_type"=>"label"),


Here is the resulting good SQL:

Code: Select all


search sql (total: 25) SELECT editions.edition_id, editions.negative_id, editions.edition_size, editions.list_price, editions.currency, editions.edition_date, editions.width, editions.height, editions.image_size_units, negatives.negative_id, negatives.print_title, negatives.image, negatives.file_sheet, negatives.file_neg_number, negatives.collection_id, collections.collection_id, collections.collection_name FROM editions INNER JOIN negatives ON negatives.negative_id = editions.negative_id INNER JOIN collections ON negatives.collection_id = collections.collection_id WHERE 1=1 ORDER BY edition_id ASC LIMIT 0, 25

search sql (total: 2) SELECT editions.edition_id, editions.negative_id, editions.edition_size, editions.list_price, editions.currency, editions.edition_date, editions.width, editions.height, editions.image_size_units, negatives.negative_id, negatives.print_title, negatives.image, negatives.file_sheet, negatives.file_neg_number, negatives.collection_id, collections.collection_id, collections.collection_name FROM editions INNER JOIN negatives ON negatives.negative_id = editions.negative_id INNER JOIN collections ON negatives.collection_id = collections.collection_id WHERE 1=1 AND ( ( LCASE(negatives.print_title) = 'casting light' ) ) ORDER BY edition_id ASC LIMIT 0, 25

search sql (total: 1) SELECT editions.* FROM editions WHERE edition_id = '582' ORDER BY edition_id DESC LIMIT 0, 25

search sql (total: 73) SELECT negative_id,print_title FROM negatives WHERE 1=1 ORDER BY negative_id DESC

search sql (total: 8) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=26 ORDER BY item ASC

search sql (total: 8) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=24 ORDER BY item ASC

search sql (total: 3) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=25 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=27 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=28 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=30 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=31 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=33 ORDER BY item ASC

POST : Array ( )

GET : Array ( [act] => [edition_id] => [er_mode] => edit [er_rid] => 582 [er__ff_collections_collection_name_operator] => = [er__ff_negatives_print_title] => Casting Light [er__ff_negatives_print_title_operator] => = [er__ff_selSearchType] => 0 [er__ff_onSUBMIT_FILTER] => search [er_sort_field] => edition_id [er_sort_type] => ASC [er_page_size] => 25 [er_p] => 1 )



Here is the bad:

Code: Select all


search sql (total: 0) SELECT editions.edition_id, editions.negative_id, editions.edition_size, editions.list_price, editions.currency, editions.edition_date, editions.width, editions.height, editions.image_size_units, negatives.print_title, negatives.image, negatives.file_sheet, negatives.file_neg_number, negatives.negative_id, negatives.collection_id, collections.collection_id, collections.collection_name FROM editions INNER JOIN negatives ON negatives.negative_id = editions.negative_id INNER JOIN collections ON negatives.collection_id = collections.collection_id WHERE negatives.negative_id = 1321 ORDER BY edition_id ASC LIMIT 0, 25

search sql (total: 25) SELECT * FROM editions ORDER BY edition_id DESC LIMIT 0, 25

search sql (total: 73) SELECT negative_id,print_title FROM negatives WHERE 1=1 ORDER BY negative_id DESC

search sql (total: 8) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=26 ORDER BY item ASC

search sql (total: 8) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=24 ORDER BY item ASC

search sql (total: 3) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=25 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=27 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=28 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=30 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=31 ORDER BY item ASC

search sql (total: 0) SELECT item,item FROM valueTableDetails WHERE 1=1 AND table_id=33 ORDER BY item ASC

POST : Array ( )

GET : Array ( [act] => 1321 [edition_id] => [er_mode] => add [er_rid] => -1 [er_sort_field] => edition_id [er_sort_type] => ASC [er_page_size] => 25 [er_p] => 1 )



The first screen shot is from a photograph with an existing edition.

The second shows a photograph where there is no existing edition..
ok.png
ok.png (30.96 KiB) Viewed 625 times


ok.png
ok.png (30.96 KiB) Viewed 625 times
Attachments
problem.png
problem.png (29.4 KiB) Viewed 631 times

Return to “Field type: "foreign key"”