0

I think I may have found a bug in the tardis branch.

It appears that if a foreign key is specified it no longer adds an additional field Listbox with fields from the foreign key table.

In the example at appspot, if I select COUNTRY as the table, then select "City" from the leftmost gwt-Listbox it adds another gwt-Listbox with the fields from the City table that I can select against.

In the Tardis branch, the label from the fks array shows up in the field selection in my case "campaign".

If I select the label I have created, "campaign", nothing happens.

If I select the label a second time, it updates the list of fields in the first Listbox with the field names from the "campaign" table, but it does this in the first box.

I was expecting something like:

campaign | campfields | (is|is not|etc)

What I am seeing is

campfields | (is|is not|etc)

My fks specification looks like the following:

"fks": [
            {
                "referenceTableName": "campdetail",
                "reverseLabel": "Campaign",
                "foreignKeyNames": "dpu_id",
                "referencedKeyNames": "dpu_id",
                "name": "campdetail_IBFK_1",
                "label": "campaign"
            } 
]

I wanted to see if there a problem with how I am specifying the foreign key, or if this is an actual bug that needs a bug report filed.

Thanks in advance, Scott

Severun
  • 2,893
  • 1
  • 16
  • 22

1 Answers1

1

Looking at http://1-7-0.redquerybuilder.appspot.com/ (tardis branch but normal meta data) it seems to be working OK.

By default the foreign key will show up as a normal scalar with associated operators unless you hide it.

Your meta data looks dodgy. Should be more like:

{
  "referencedTableName": "COUNTRYLANGUAGE",
  "name": "COUNTRYLANGUAGE_IBFK_1",
  "label": "Language",
  "foreignKeyNames": [
    "CODE"
  ],
  "referencedKeyNames": [
    "COUNTRYCODE"
  ],
  "reverseLabel": "Country"
}

So at least a missing "d" from referencedTableName... I'd expect some horrible stack trace if that is the data you used.

Hope that helps!?

salk31
  • 995
  • 2
  • 8
  • 13
  • I did catch the "d" missing in reference, but that turned out to not be the issue. The issue came from not having foreignKeyNames and referencedKeynames in an array. It should have been: "fks": [ { "referencedTableName": "campdetail", "reverseLabel": "Campaign", "foreignKeyNames": [ "dpu_id" ], "referencedKeyNames": [ "dpu_id" ], "name": "campdetail_IBFK_1", "label": "campaign" } ] tyvm :) – Severun May 29 '14 at 19:55
  • OK. Was there any sane error at all? If not please could you raise a ticket? – salk31 May 30 '14 at 07:25