• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Joined list on "add" using url's key

lcollong

FabriKant d'applications web
Hi,

Let consider list A which is joined on list B. A contains a B_FK on which the join is made to B's id. When you display a row of A, it shows up all the joined elements of B in a specific group. Nice.

If I create a new row in A all the fields are empty, including the joined ones as the B_FK is unknown. But, if the B_FK is prefilled before the form is loaded through the URL ( index.php?option=com_fabrik&view=form&formid=1&Itemid=17&tableA___B_FK_raw=12), it should be possible to display a form with the A's fields empty but with all the B's ones filled based on the B_FK value.

Is this possible ? How ?

I don't think the Autofill plugin is the right one as I don't want to fill A's fields based on B's ones. I just want the B fields being displayed (read only) and usable (in A's calc elements).

Any idea ?
 
You might be able to do it with the autofill plugin as long as you specifiy only the B fields in the "map data" section.
 
Thanks Rob. But will the B's fields be reachable as I want them readonly since they will be "filled" with the joined value upon saving the form ? In others word, while creating a new A row, I need to fill A's fields based on the value of some B's fields. Since the A table will be joined to the B one on an existing B row, I have to reach these values but not modify them.
 
Have to say it would be easier for me if the example was a bit more concrete, I always struggle to understand things when explanations are given with TableA and TableB, as the labels don't designate the relationship in the same way that say 'countries', 'regions' does.

However, I would imagine that you can set the acl of those fields to none-editable and the autofill might still work. Or alternatively set them to be fields with the readonly property turned on.

Have you tried using the autofill yet and it doesn't work, or are you just checking before testing?
 
This is essentially a special case of what I've been banging on about for a few years, of a "selectable" list join.

As the moment, Fabrik's list joins only allow for creating new joined rows. You can't open up a form for (say) "invoices", which is joined to "customer", select the customer you want from a dropdown, and have it populate the joined group with that existing selection.

The only way we have for selecting an existing 'customer' is with a join element, but that only gets us the FK, and potentially using autofill to grab values from the selected row, and stick them in other elements.

What would be absolutely peachy keen would be if we had a 'hybrid' of the join element with the List joins, so when you set the FK in the List join settings, and if that FK is a visible join element on the form, it allows you to designate that FK join element as an 'autofill' trigger/source, that populates the joined group's element data with the selected row data.

What lcollong is describing is essentially just a special case of this, where the FK's join element has a default value, and hence acts like the autofill's "run on load" option, and where the join'ed group is read-only.

I *think* Rob's suggestion would work ... and would basically be doing by hand what I would like to provide as a built in option on the List joins.

I've been trying to think of a way of doing this on and off for several years, but I want to find a low impact way, that doesn't require much (if any) change to the core list join or element join code. And I think this discussion has given me the idea I need. We basically already have all the code we need to do this, it's just a case of adding some "glue" and splicing it together.

I'm not saying I'm going to rush off and do it now, but I am going to let this idea percolate for a while. Replace lid, simmer on low heat for several days. See what happens.

-- hugh
 
Hi Hugh,

I love the concept of this idea percolating in your brilliant brain ! ;)

Your analysis covers exactly what I was trying to explain. For now, I've started using "duplicated" some elements of B in A used for some computations/decisions. I'll test the autofill feature to see if it fits my need.

Fabrik is already "a must" to build complex application, but with some of these additional features it could become "incontournable" !

Cheers
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top