1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Dropdown with multiple selections

Discussion in 'Community' started by mariluzrm, Jun 15, 2021.

  1. mariluzrm

    mariluzrm Member

    Level: Community
    Hello.

    How does Dropdown with multiple selections work?

    If I select more than one option it saves the value 0 in the database, but I suppose that this should not be the case, right?

    Thanks
     
  2. juuser

    juuser Well-Known Member

    Level: Community
    Fabrik has probably created a repeat table "your_main_table_xx_repeat" for storing multiselect values.
     
  3. mariluzrm

    mariluzrm Member

    Level: Community
    No, a repeat table "your_main_table_xx_repeat" doesn't exist.
    Any ideas?
    Thanks
     
  4. lousyfool

    lousyfool Active Member

    Level: Community
    Well, to be exact, the new table Fabrik generates for multi-selects with databasejoins is named following the convention "tablename_repeat_elementname".

    So, if the table holding your multi-select is named "jos_mytable" and the element column is named "eee", the Fabrik-generated table will be named "jos_mytable_repeat_eee".

    Please check again?
     
    Last edited: Jun 16, 2021
  5. mariluzrm

    mariluzrm Member

    Level: Community
    I have checked it. There is no table with the name *_repeat_*, and when I select on dropdown only one option then it's saved (and I can see the value in phpmyadmin), but when I select more than one options it's saved 0 (in phpmyadmin) and in dropdown no value is marked.
     
  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    You mean a dropdown element with multi selection (not a dbjoin with multiselect, which will create the repeat table)?
    A multiselect dropdown with more than one selected value is stored as ["2","3","10"].
    So no idea what is going on on your site. The column type must be text.
     
    lousyfool likes this.
  7. mariluzrm

    mariluzrm Member

    Level: Community
    It's a dropdown element, no a dbjoin. That was the problem, the column type
    Thanks!!
     
    lousyfool likes this.
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    But then it was no original Fabrik element. You should mention such settings.
     
  9. mariluzrm

    mariluzrm Member

    Level: Community
    It's true i'm sorry.

    Which element is better to show multiple selections, checkbox or dropdown? Is there any other? Thanks
     
  10. troester

    troester Well-Known Member Staff Member

    Level: Community
    It's up to you. Dropdown multi and checkbox are nearly the same (sames storage in the DB), you can also use a dbjoin rendered as checkbox or as multiselect.
    With both multiselects you can enable "Enhanced dropdowns" (you need to enable it in Fabrik options, too) which will give some "tag" like display.
     
  11. mariluzrm

    mariluzrm Member

    Level: Community
    Thanks!!

    I don't understand the next:

    what is it for?
     
  12. troester

    troester Well-Known Member Staff Member

    Level: Community
  13. mariluzrm

    mariluzrm Member

    Level: Community
    Thanks!!
     

Share This Page