Cascading Dropdown List Not Populating

Stranger

New Member
This is my first time working with Fabrik's cascading dropdown element. The cascading dropdown list is not populating from the database table, as I expect it should, for some reason. I have spent a couple of days poring over the problem and reviewing old threads and tutorials to no avail.

The "watched" element (career_pathway) is populating from the table which is expected since it is a database join element with the database, table and column specified in the data tab.

But the cascading dropdown (or the "watching") element (occupation) is not populating. It is a cascading dropdown plug-in, rendered as dropdown, and has the Fabrik-created ID as an ID. The watch element and the foreign key are one and the same which is (career_pathway) mentioned above.

In the data tab section, the database table containing both fields is shown as a connection, and so is the list containing both fields and the ID is the list ID created by Fabrik.

Frankly, it makes sense to me that the dropdown list should not be populated because even though the database table is listed as a connection, the column from which the list is to be populated is nowhere to be seen. How would Fabrik know which one it is?

If somebody could explain that to me, I will get closer to solving the problem. Or if somebody has noticed something wrong that I have done from my detailing of the problem above, I will be grateful if they point it out.

Best regards.
 
the cascading drop down (ccd) should be populated after you have selected something in the watched drop down.
You may post some screenshots of your settings.

gesendet mit Tapatalk
 
Hi, I had an intention to open a new thread but I think I can well write here. The point where cdd is not working for me is related to list joins. Until some time I coud just use the watch/foreign key method when the element pointed to some list PK but the watch element was rather related to the list's joined data - so the FK was not in the main table nut in joined group. Now I have to leave the fk unselected and write a subquery in where statement instead. Not a big deal but...
 
Thanks for responding. The settings screenshots are attached. If I missed anything please let me know.
As I mentioned, I am new to CDD and I am still struggling with the concept of how the Fabrik list knows which table column to take the data from. In a databasejoin element you clearly specify the table and column. In a CDD you specify the table but not the column. How does Fabrik connect the the list field to the database table column?

image.jpg image.jpg image.jpg image.jpg image.jpg image.jpg image.jpg
 
How does Fabrik connect the the list field to the database table column?
Your CDD list must contain a foreign key to the dropdown list
so if you have a states list (used in dbjoin)
id statename
1 USA
2 Canada

dbjoin settings:
value = id
label = statename (or whatever, doesn't matter here)

and a city list (used in CCD)
id- state_id- cityname
1 -1 -new york
2 -1-boston
3-1-Seattle
4-2-Vancouver
5-2-Toronto

in the CCD stettings
Watch element = states
Foreign key = state_id
 
Thank you. I am getting closer to figuring out what's happeng here. There is a problem with my CDD list. It takes data from a table with 3 columns (or two, for all intents and purposes, since the second colum is just a code for the third). Neither column is unique on its own but together they are. In the state and city example the state of California occurs in the first column as many times as there are cities in it. While the city of Springfield, for instance, occurs once for each state so there are 50 occurrences of it in the 2nd column. So neither one is unique in its column but the database unique index is a concatenation of both (CASpringfield is unique). Now my CDD list doesn't seem to understand that and tells me that I have a duplicate entry for the database unique index. How do I make the CDD list understand that? I suppose I will have to use CONCAT somewhere but (in Fabrik at least) this is a new thing to me.
 
Hi stranger,

The way the list is populated is by giving each item in the first list a unique ID and using this as the foreign key in the second list. So lets say you have a list of Countries and States. In the database you will have each country with a unique id. In the states each states will have a unique ID as well as country_id.

So as an example you could have a list of every country in the world having USA having an ID of 255. In order to populate the list your fields for the states would have id,country_id,name Any states that belongs in the USA category would then have a country_id of 255. So New York could look like id=45,country_id=255,name= New York.

So when you want to populate the drop-down you would create a normal drop-down for the Country, and then use the Cascading Drop-Down on the states and watch the country element. Set it to where the ID of the country list is equal to that of the country_id of the cities list and it populates.
 
Hello everybody

I finally got it to work. Thanks to everybody who took time out of their busy schedule to help a fellow designer/coder. troester, Jaanus and valandor062 (in chronological order of your posts): your help was immensely valuable and the educational experience was exhilarating (albeit frustrating at times).

Jaanus, if you have time and would like to elaborate a little on how and where you use the WHERE subquery I would appreciate it.

Thanks again everyone.
 
OK, see this. In Watch section there should be choosen a field from the list Muusikateose algandmed but this field is not in the list's main table (I explained this situation above).
So I use custom Where with subquery to get the data.
cdd_subq.png
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top