• 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.

How to stop Fabrik from saving/adding data to a join field

Hi all,
I am new to Fabrik and I found a strange issue:
Description:::
================
I have 3 tables:
+ Organisations for keeping data about organisations with fields of (Id, Ward_id, Name, Address)
+ A table named Wards for storing listing of wards (Id, District_id, Name)
+ A table named Districts for storing listing of districts (Id, Name)

I created a list for Organisations and created left joins to wards and districts so that
+ organisation:::ward_id joins with wards:::id
+ wards:::district_id joins with district:::id

Element named district_id is a databasejoin and set store to db to failse
ward_id in organisation is a cascadingdropdown

However, when I create an organisation, select a district then a ward and save, a new blank record was inserted into the district table.

As I want the district for selection only, no update, no saving, no addition, this is a kind of unexpected result.
Please help me to find a solution on this with thanks.
Yours very faithfully
Dang Dinh Ngoc - Vietnam
 
I don't understand why you are adding list joins. If you want to select a value/label just use dbjoin elements (or cascading drop downs).

But if you have list joins:
It depends on your group settings if a related record is created.

If your joined group is set to repeat=no it's a 1:1 join and a record is created in the joined table.

If your joined group is set to be repeatable you can set Minimum repeat=0 in group settings.
 
I don't understand why you are adding list joins. If you want to select a value/label just use dbjoin elements (or cascading drop downs).

But if you have list joins:
It depends on your group settings if a related record is created.

If your joined group is set to repeat=no it's a 1:1 join and a record is created in the joined table.

If your joined group is set to be repeatable you can set Minimum repeat=0 in group settings.

Many thank to Troester, I will try for now!
 
Hi Troester,
I tried to remove join from my list and added an element district_id with type of dbjoin, however, Fabrik throw an error telling that "You can't add fields to this list". Of course, I configured fabrik to not allow to alter the database.
So, please assist me in creating a set of dbjoin and cascadedropdown for selecting a ward_id for the organisation as the list will be 12000 ward_id if I dont have such mechanism to filter the ward_id for each district!
Thank you for your attention!
Dang Dinh Ngoc

P/S: If I create a new field district_id in the organisation table, this can be fixed but I dont like to create this new field in the table as it would waste bits of data if the table organisation will be expanded!
Another direction for this would be using Store in Db as no feature for joined element and try to alter the public function storeRow() in your list.php model.
But I am new to php and would never be able fix this problem!
 
Last edited:
try to alter the public function storeRow() in your list.php model
No, don't hack any Fabrik core files.
If I create a new field district_id in the organisation table, this can be fixed
This is the usual way.

But if you don't want to have a dbjoin + a CCD you can do:
Set ward_id as a dbjoin with "Front end select" enabled. This will show a "view" icon beside the dropdown which will open a popup with your ward list.
In the ward list set District_id as dbjoin and set it to be a list filter.
Then you can filter your ward list by districts and a click on one of the rows will select this ward in your ward dbjoin.
 
No, don't hack any Fabrik core files.This is the usual way.

But if you don't want to have a dbjoin + a CCD you can do:
Set ward_id as a dbjoin with "Front end select" enabled. This will show a "view" icon beside the dropdown which will open a popup with your ward list.
In the ward list set District_id as dbjoin and set it to be a list filter.
Then you can filter your ward list by districts and a click on one of the rows will select this ward in your ward dbjoin.

Thank you Troester, I am trying this now for sure!
All the best!
Ngoc

/////
I have just tried your solution but at Font End Select, I found no link form to this! Can you show me how to do this linked stuff?
I have created a list name wards that pointed to this table from the begining. A form also linked to this table as well. However, when I created a ward_id as a dbJoin with Front_Select - nothing show for selecting a form to pop up!
If you can, please support me at the site inforcb.sfdp.net/administrator with thanks. I will send you password if you would be so kind to teach me on this matter. My skype id is paulsteigel.

Thank you very much for your attention!
 
Last edited:
Hi Troester,
I have a small question:
I applied your second option successfully with front-end-select and dbjoin. However, the table organisations have thousands of records, also the wards is thousands too. The Front_end_select for Ward_id will load almost 12000 of record to the list and it would be a big problem for server load.
Would you please advise me on how to:
1. Create a filter for Organisation so that It can filter data that base on District selection and later Ward selection (at view mode);
2. Create a dbJoin with specific dbJoin Where option so that the ward_id dbjoin will not load 12000 record into the list.
Thank you very much for taking time helping me!
Yours very faithfully
Dang DInh Ngoc
 
The Front_end_select for Ward_id will load almost 12000 of record to the list
No. It's loading the Ward list (in the popup) with its list settings. So only the first page with 10 rows (depending on your "rows per page" settings), you can even set filters to be required.

Set the ward_id dbjoin to "Render as"=Auto-complete so you won't get a huge dropdown.
 
No. It's loading the Ward list (in the popup) with its list settings. So only the first page with 10 rows (depending on your "rows per page" settings), you can even set filters to be required.

Set the ward_id dbjoin to "Render as"=Auto-complete so you won't get a huge dropdown.
Thank you very much for your advise... I am trying for now!
Yours very faithfully
Dang Dinh Ngoc
 
Hi Troester
It worked like a charm!
Thank you very much for your support!
However, I can not avoid creating district_id in tblOrganisations as this needed for grouping and filtering on the list of Organisations (this is a very big list and need filtering). If you would have any suggestion, please do advice me with thanks.
Faithfully yours
Dang Dinh Ngoc

P/S: I found some problems!
1. If I select a ward once and I would like to change to other ward, the next popup form will be failed in having filter feature!
2. As I set district_id to be hidden (but still published for filtering), when select a commune, sadly, I have no way to keep district_id to be updated with a new district_id result from selection of the new ward! Can you advice on this?
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top