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

Embedded list popup

Discussion in 'Community' started by Bren, Jan 13, 2019.

  1. Bren

    Bren Member

    Level: Community
    Hi all.
    I have a Fabrik details page that also has a list that displays within it via the following embedded list via the content plugin.
    Code (Text):
    {fabrik view=list id=35 bw_pos___fid=[rowid]}
    This List has a check box & a field element within it. The end user would like this information to also appear on the parent list so that he doesn't need to click into the details of each record to see which items are listed and checked off. I'm hoping there's a way to have this info list in a display or calc element in the parent list and when this element is clicked in the parent list a popup (media box) would appear displaying the embedded list (versus clicking into the details on the parent list. Any suggestions anyone?
    Thanks in advance.
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    If I got you correctly you can use "Related data":

    In your child list set the bw_pso___fid to be a databasejoin element to the parent list.
    Then in your parent list in Data/Related data enable the list with Popup=yes.
     
  3. Bren

    Bren Member

    Level: Community
    Hi Troester.
    Cool. I've never quite understood how it worked or knowingly used the Related data list settings. Now I'm starting to understand. I just tried your suggestion (using a multi-select drop down type - not sure if it matters) and I assumed that when I double-click on the new DBjoin element that the sub list would pop up in a media box; but it doesn't do anything. Am I missing something?
    Also, I made a mistake noting above that the embedded list had a checkbox. The checkbox is actually a YesNo Element called bw_pos___received. When I Concat label the DBJoin with "received, ' ', po_number"; then the YesNo portion shows the zero or one (versus an X or check mark image) next to the PO number. Any suggestions on how I can correct this to show the check mark instead of a one & nothing instead of zero?
    Thanks in advance.
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    It must be a single dbjoin.
    If you enable the "Related data" in your parent list for "list" with this dbjoin element
    upload_2019-1-14_21-49-44.png
    your parent list will show an extra related data button.
    Something like
    upload_2019-1-14_21-47-26.png
     
  5. Bren

    Bren Member

    Level: Community
    OK, so, I assume you are saying "dropdown" when you say "single dbjoin", correct (as attached)?
    I did as you suggested in the related data settings of the PO list (as attached) and then refreshed my material list on the front end; but those buttons do not appear... Could there be another setting I missing?
    Thanks in advance.
     

    Attached Files:

  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    Is pw_pos your parent table?
    The "value" must be the primary key of the parent table (usually id[recommended]).
    The button will show up in the parent list (PO?)
     
  7. Bren

    Bren Member

    Level: Community
    I thought there might have been some confusion there (primarily on my part). The "MaterialShelf" List is what I would consider to be the parent table and the "POs" list is what I would consider to be the sub/child list. What I'm hoping to do is when a user is on the "MaterialShelf" List the POs DBjoin element would contain only POs that are related within/to each "MaterialShelf" record. Then the user could click or double click on the POs DBjoin element within the "MaterialShelf" List and a POs pop up media box with an editable list of these same listed POs that are relevant to the "MaterialShelf" record. The primary key of the "POs" list is bw_pos___id. The primary key for the "MaterialShelf" List is bw_projects___id. So, are we still heading in the right direction (I'm still trying to wrap my brain around this)?
    Thanks in advance.
     
  8. Bren

    Bren Member

    Level: Community
    I tried reversing things and setup
    The new DBjoin in the POs List instead; which points to the MaterialShelf List & PK id. Then, after updating related data in the MaterialShelf List I saw the added column you mentioned. The problem though is that when I add a PO then it doesn’t update the count in the new column. When I click on the new column 0 count a popup media box appears and never finishes loading. Any suggestions?


    Sent from my iPhone using Tapatalk
     
  9. troester

    troester Well-Known Member Staff Member

    Level: Community
    'Loading' sounds like an error message in the network respose.
    Check in your browser dev console or set popup= No to see the error.

    Gesendet von meinem SM-G930F mit Tapatalk
     
  10. Bren

    Bren Member

    Level: Community
    Ya, you're right. I've got an error page "500 - Fabrik has generated an incorrect query for the list POs: <br />" when I turn off the the popup. I'll have to dig deeper into that.
    Exploring this option reminded me that until now using an Embedded list as a sub-list to records from another list; I've been saving session variables from the parent list record on form load and then retrieving these variables and saving them to a hidden foreign id (key) in the child list record additions. I believe I've never asked if there's an easier way within Fabrik to do this (maybe by using DBjoins wiser). If so, please share.
    Thanks in advance.
     
  11. Bren

    Bren Member

    Level: Community
    Friendly Bump.
    Thanks in advance.
     
  12. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I'm really not sure what you are trying to do ...

    Have you tried using the "related data" feature of lists?

    -- hugh
     
  13. Bren

    Bren Member

    Level: Community
    Hi Hugh.
    Yes, that’s where Troester has been leading me in this thread. I’m actually surprised I haven’t messed with it until now. My question is whats he right approach for the joining part? I’ve been digging through past Fabrik wiki help pages and threads; but nothing really takes you step-by-step with setting it up correctly between 2 separate lists. I stumbled onto an old Fabrik tutorial page that appears to; but all the tutorial web links are broken and go nowhere now. Do u have a web link to a simple tutorial or can you share a simple step by step for properly joining 2 lists (parent / child like I mention in this thread)?


    Sent from my iPhone using Tapatalk
     
  14. Bren

    Bren Member

    Level: Community
    Friendly bump.
    Thanks in advance.


    Sent from my iPhone using Tapatalk
     
  15. troester

    troester Well-Known Member Staff Member

    Level: Community
    http://fabrikar.com/forums/index.php?wiki/list-joins/#adding-a-join
    This for list joins (joining two database tables).

    Your 1st post and "related data" are about database join elements (using an other list as lookup table)
    http://fabrikar.com/forums/index.php?wiki/list-related-data/
    http://fabrikar.com/forums/index.php?wiki/database-join-element/

    If you want to use a dbjoin element for "related data" it must be single select (render = dropdown or radiobutton) and the "value" must be the primary key of the selected table (usually id[recommended])
     
  16. Bren

    Bren Member

    Level: Community
    Great. Thank you, troester. I’ll check these links out.


    Sent from my iPhone using Tapatalk
     
  17. Bren

    Bren Member

    Level: Community
    With related data, is there any way to move the “linked to list” extra column to another spot in the parent list (instead of the far right beside the edit form & details buttons)? This parent list that I’m trying to apply it to has a flow process from left to right in the list and it would make more sense on the left as the 3rd or 4th column. Is that possible?
    If not; then that’s where I was wondering if the “linked to list” column could be replicated using a calc element or something...
    Thanks in advance.


    Sent from my iPhone using Tapatalk
     

Share This Page