1. We suggest you do NOT update to Joomla 3.8.10 until we can resolve an issue it causes with caching in Fabrik. If you do install it, you'll need to disable Joomla's "System Cache" in the global System settings.
  2. Apologies for the recent server outage, a planned migration by our host provider to a new location turned into a bit of a nightmare.

CascadingDropdown

Discussion in 'Community' started by wael.salman, Jul 12, 2010.

Thread Status:
Not open for further replies.
  1. wael.salman

    wael.salman New Member

    Level: Community
    Hi,

    I have found many posts about cascadingDropDown issue , but never could find a simple - very simple organized tutorial about that. Any way, consider that I have 2 simple elements.


    1. Region Drop Down element - which has 5 items " Item1 , Item2 , Item3, Item4 , Item5"
    2. Clicking on one of the Items - for example "Item1" will create dynamically "City" drop down element, which will include all cities which are in Item1. The same issue for other Items.
    3. I believe that the Region should be database-join, which should be connected to some database table , that will include "Item1, Item2, Item3, Item4, Item5" - Correct me if I am wrong :) Please let me or explain to me how to do that - how to create the table and connect it. Should I create it in MySql?

    Please try to help me in that.

    Thank you
     
  2. peamak

    peamak Moderator

    Level: Community
    I think there's a tutorial for subscribers.

    The first dropdown can be either a databasejoin or a simple dropdown. The important thing is the value of each element in the dropdown.

    So you can have a driopdown Region:

    Value --- Label
    region_1 --- Region 1
    region_2 --- Region 2
    ...

    This value needs to be in the City table, like this:
    ID City --- Name City --- Region ID
    1 --- My City 1 --- region_1
    2 --- My City 2 --- region_1
    3 --- My City 3 --- region_1
    4 --- My City 4 --- region_2
    5 --- My City 5 --- region_2

    So the cascading knows what cities to show once a region has been chosen.

    I'm basically repeating what you probably saw in other threads but I hope it helps.
     
  3. wael.salman

    wael.salman New Member

    Level: Community

    I have started to build that , but something is making me confused.
    After creating the Region as dropdown, I have created a table called "Cities", but the joomla gives me an option to create the database in MySql , and I could not figure out how to fill the database data with the cities names.

    How to do that please??



    What is m trying is the following:

    Going to localhost/phpmyadmin gives me the ability to build databases and tables.
    I have created 2 tables.

    First one "qadaa_Ishamal" with 3 columns. how to fill the data there?? what attributes I have to care of there??

    Second table "qadaa_ilmrkz" with 2 columns.


    One issue here that I am not feeling good with is that I must create these tables inside the my Main Site database. If my site is called "wavojobs" , so I find in myphpadmin a database called "db_wavojobs", and then I have to create 2 tables as mentioned before inside this database.

    Why if I created a new database with 2 tables as mentioned before , i cannot see that in Fabrik Backend (Tables), when i want to connect to the database?

    Secondly, if I create 2 tables as mention before inside the "db_wavojobs", so how to connect that to every selected element in the region drop down?? Means, consider that Ia m selecting on item1 in the region dropdown, how to connect that to one of the previous tables??


    Hope that explains my problems. Hope also you can help.

    Thank you
     
  4. peamak

    peamak Moderator

    Level: Community
    Don't do anything in phpMyAdmin: just do it in Fabrik.

    If your tables already exist in your DataBase but not in Fabrik, then just create a new table in Fabrik and select "link to: [your DB table]" instead of entering a new table name (under the DATA tab).
     
  5. wael.salman

    wael.salman New Member

    Level: Community
    Ok. I understand. I deleted every thing - starting again :)
    So I need to create 2 tables in Fabrik.

    1. regions table - which will contain few items " North, South , Center". I do that by Fabrik , creating table , and in Data Tab-->Create New Table , I am creating the new table.

    The questions here - What elements should this table contain??
    For that, I am going to elements , and drop down element with " North, South , Center"..


    Is it right till now?? :)

    Please stay with me for w while here so we can do that together, and I will be so thankful
     
  6. peamak

    peamak Moderator

    Level: Community
    If you look at my post #2, you'll see that you can use a normal dropdown for the Regions.

    But if you want to use a specific table, as you can see in my example, you'll only need 2 fields:
    Region ID and Region Label (or name)
     
  7. wael.salman

    wael.salman New Member

    Level: Community
    I looked in your example , but could not do that.

    So let us work with the drop down option.
    I have the Region drop down ready , and I can see it in my profile.

    Now. I have to create another table for cities.

    Let us say we have the following cities : City1 , City2 , City3 , City4 , City5 , City6

    every Region will have 2 cities - just for demonstration.

    North has City1, City5
    South has City2 , City4
    Center has City3 , City6

    If I create new table by Fabrik - call it Cities, and in the Data Tab-->create new table , I give a name cities_table, then the table is ready.

    Now what elements I have to add to this table, and how to connect every city to the right region. I cannot see any option in Fabrik .
     
  8. peamak

    peamak Moderator

    Level: Community
    Please, look at my post #2 where I explain exactly that...
     
  9. wael.salman

    wael.salman New Member

    Level: Community

    I am sorry , but that is not clear to me.
    Can you follow my latest example here so you can tell me how?
    Just for the last one more time
     
  10. peamak

    peamak Moderator

    Level: Community
    Well, ok but you don't give the impression to try very hard:

    Value --- Label
    region_north --- North
    region_south --- South
    ...

    This value needs to be in the City table, like this:
    ID City --- Name City --- Region ID
    1 --- City 1 --- region_north
    2 --- City 5 --- region_north
    3 --- City 2 --- region_south
    4 --- City 4 --- region_south
    etc...
     
  11. wael.salman

    wael.salman New Member

    Level: Community


    Believe me that i am not posting here unless I am trying too hard.
    I spent the whole night trying to do that - slept at 5 in the morning but could not. I sit enough hard work??

    Thank you anyway for your impression
     
  12. wael.salman

    wael.salman New Member

    Level: Community
    waooooooooooo
    Finally I have succeed :)

    Thank you so much - I appreciate that so much.
     
  13. andy_rokks

    andy_rokks New Member

    Level: Community
    peamak, i have the same problem, please help me too. i have fabrik 3.0.8.

    1st table:
    ID Country --- Name Country
    1 --- Country 1
    2 --- Country 2

    2nd table:
    ID City --- Name City --- Name Country
    1 --- City 1 --- Country 1
    2 --- City 2 --- Country 1
    3 --- City 3 --- Country 2
    4 --- City 4 --- Country 2

    1st elemen:
    -plugin = databasejoin
    -render join as = drop-down
    -connection = mydatabase
    -table = Country
    -value = Country
    -label = Country

    then what?
     
  14. paulknox

    paulknox New Member

    Level: Community
    I have a cascading drop down setup and working on a form but I need to setup a third cascading drop down. My setup is

    a dropdown menu that loads a cascading drop down menu below

    so i would like a third cascading drop down menu below that which triggers with the first cascading drop down... if that makes sense!

    any ideas?
     
  15. troester

    troester Well-Known Member Staff Member

    Level: Standard
  16. paulknox

    paulknox New Member

    Level: Community
    Thanks for the link.... time for more reading and trying!
     
  17. learningFabrik

    learningFabrik New Member

    Level: Community
    Thanks for the info here.
    I was able to create a cascading drop-down based on another drop-down.
    I was testing on latest version of Chrome and it was not working.
    I tested on IE 8 and it works fine.
     
  18. troester

    troester Well-Known Member Staff Member

    Level: Standard
    Which info, the 3 years old or the WIKI?
    Closing this thread.
    Please open a new one in the appropriate forum, mentioning Joomla and Fabrik version.
     
Thread Status:
Not open for further replies.

Share This Page