Cannot set selected elements for the list module on Joomla Fabrik extension - joomla

I am using free version of Fabrik extension on Joomla. Both my Joomla and Fabrik are the latest version
I have already done with the Fabrik structure part such as create the form, elements, group, list, and set the form order, validations, appearance, and make them all works. Any registered user can submit the data using the form and it'll be stored into a table on the database
On the front-end, the idea is the user can view two different list view modules through his/her profile, a private list and a public list
Module A lists only entries submitted by the user. The list show the whole entry's data
Module B lists all of the entries submitted by everyone. The list show only selected data from selected field from each entry
This where the problem came from. When I gonna create a module for the list view (Fabrik List Module)
Module Manager > New > Fabrik List Module > Advanced
After I set the title and the list, when I clicked on the 'Select' button for attribute 'Elements', it just response me like I just clicked on 'Cancel', and redirect me to the modules list table instead. If it is just an unfixed bug, I can do nothing about it, but I guess it'll be a lot easier if I can just set something directly using database admin

Finally, after some little hacking, i've succesfully figured it out. Go to [pre]_menu.params (for menu item) or [pre]_modules.contents (for module), and you'll see some json like this
{"calculations":"0","listlayout":"bootstrap","resetfilters":"0","list_elements":"null", ....}
Just replace list_elements value from "null" to this
"{\"show_in_list\":[...]}"
[...] contains the list of elements id (inside table [pre]_fabrik_elements) we want to select them on module view, for example [1,2,3,4,5]
updated :
It's very unpractical solution to just modify the joomla data directly on database. Actually, especially in similar case to mine (sure it is a bug), you can select the elements for a list view (as asked) by simply creating a new separated list apart from the auto generated list which is generated by default on form creation.
That new list will automatically generate new set of elements with new ID based on database table structure, and plus they will not shared their setting with the default list. Alter the default list should definitely be avoid as it will totally change the behavior of the form
On the new list, you can simply un-"show in list" any elements you don't want to show, and create either menu item or module linked to the new list. This is also the best way if you want to alter the list displaying such as change the list header field title, change the list description, or join others elements to the list

Related

PowerApps for MS Teams - Duplicate record added to combobox when setting DefaultSelectedItems

I am developing a Power App using the Teams version. We have two tables in Dataverse acting as the main data sources. There is an inheritance relationship between these two tables, where one holds parent objects and the other child. I have an overview screen which displays a single record and it is important that a user can select both parent and child records from a single combobox and have the data associated to the selected record displayed.
In order to achieve this I have a collection which holds the ID and Parent/Child type of each record to form a full list of records from both tables. Collection is built as follows:
ClearCollect(Collection_RecordSelect,AddColumns(ShowColumns(record_parents,"recordID","recordID_numeric"),"type","parent")); Collect(Collection_RecordSelect, AddColumns(ShowColumns(record_children,"recordID","recordID_numeric"),"type","child"));
When a user selects a record from the combobox, the ID value from the collection is looked up against the respective data source to get the rest of the data for the record.
The issue I have now is, when a user makes a change to a record in another screen, the app returns to this overview screen to show the record they have just changed. To achieve this I used the DefaultSelectedItems property of the combobox which looks at a selectedRecord variable containing the record ID as a string, set after a user changes the record in another screen. As the combobox requires a record, the combobox uses the selectedRecord variable to Lookup into the collection I referenced earlier to get the full record, unless it's blank in which case it default to the first record. Shown below:
If(IsBlank(selectedRecordID),First(Collection_RecordSelect),Lookup(Collection_RecordSelect, recordID = selectedRecordID))
This results in the combobox displaying two instances of the selected record and showing the old version of the record before the user made changes on the overview screen. If you select another record, the duplicate disappears. If you select the other duplicate record in the combobox, the user's changes are then shown on the overview screen.
Screenshot of duplicate record in combobox.
I have tried creating a single collection, containing all records from both tables, however as they are slightly different due to the inheritance field in the child table they don't merge properly and data is missed. Unfortunately, I need the inheritance field on the overview screen so I can't use ShowColumns and remove it.
I have recently re-built the app in Teams as opposed to standard Power Apps. This solution worked fine in the standard Power Apps environment, so I have a suspicion it may be a bug with the Power Apps for Teams combobox? Unless I am making a mistake, I think this is probably true as I've just tested and the "Classic Control" combobox doesn't have the same behavior, shame because it looks rubbish compared to the Teams one!
I have turned off multi-select on the combobox and search and the problem still exists.
Any help would be hugely appreciated!

Joomla 4 - View with multiple parents

I'm trying to setup the router configuration for the first time in Joomla 4 and ran into a problem. I want to show the same item below different parent views. The parent views generate lists with items and for details i want to show the items on the same url, below the parent.
There are three Views a user could add in the menu: Listing, Search and Item.
These URls should be possible to generate:
/search/item1
/listing/item1
/item1
The problem is that i can only generate these urls if i set something like
$itemView->setParent($searchView)
Or
$itemView->setParent($listingView)
But i need both, depending on the Menu-Item where the item should be displayed. Without setParent i get URLs like /search/?view=item&id=xx.
I'm happy for any ideas!

Allow adding data to textbox but not editing with Fabrik on Joomla?

I am displaying lists using the Fabrik system with Joomla on my website and want the users to be able to add information to each row but not be able to delete anything. Currently I have it setup so that a user can click the edit button but that allows them to edit all of the data in a large textbox. I just want them to be able to add information to the textbox but not delete pre-existing information. Any help is greatly appreciated! I am using the most recent versions of Joomla and Fabri
Humm if I well understand: not easy (and maybe not advised).
An idea:
A new Calc field recovers and displays the current value from your field.
A Custom PHP in your field (Advanced tab) empties your field. Finally, just after submission a Php Form Plugin changes your field adding the Calc Field concatenated with the new current value from your field.
But really I think it is not advised. Not because Joomla or Fabrik or PHP, but because ... the interest of database applications.
You would prefer to create a linked table, in your List options, Data, Join.
Add your new table as repeatable.
Go in Group, find your original List, find the new group related and set up the options.
I guarantee you that finally you will be able to do what you want, but benefiting from much more possibilities (date of edit, user edit, ACL according to user rights ...).
I would add a second field for new data and create a trigger to add this information to the already existing information upon update of the row

Rails: disable input tag upon selection from a dropdown menu

Scenario/Context
I've got a drop down menu with two input elements underneath.
From the dropdown menu, are names of companies (with values set to the respective company id's), and another prompt to Add a new company.
If the option to Add a new company is selected from the dropdown, then the user is to fill out the 2 input field elements (i.e. company name and company email).
Otherwise, if an available company is selected from the dropdown,
then the 2 input fields (for company name and email are to be disabled).
My question
Is this possible to do without an AJAX call if I want things to happen without a page refresh?
Can anyone suggest some other alternatives??
Many thanks!
That is absolutely possible, though you'd need to use some JavaScript to make it happen and load a bit more data to the DOM on the initial page load.
For each option in your company select dropdown, add a data attribute for the name and email.
Then, watch that dropdown for the change event in JavaScript. Whenever that event is fired, if the data-company-name and data-company-email attributes are defined for the selected option, disable the input fields and populate them with those values. If those data attributes are not defined for the option (likely only for your 'Add a new company' option), then clear the values from the input fields and enable them.

InfoPath 2007 - Populate drop-down list on-the-fly

I'm working on an InfoPath 2007 form. I have two drop-down lists and i need the second to be populated with items bases on the value chosen in the first list. I use c# to populate the drop-dpwn lists from external sources. I've tried to use the OnChange event to make all this, but the second list is still empty.
If anyone knows, please tell me.
You can filter the entries for the second drop-down list based on your first list (but only if the entries are based on a data source, not manually entered).
Bring up the properties window for
your second drop-down list.
Select your data source.
Click on the button to the right of the Entries text box.
Select the repeating node you wish to use for the basis of your list entry.
Click the Filter Data button. From here you can enter a filter to limit the entries displayed based on the value of your first drop-down list.
Your question was a bit ambiguous. You may be trying to populate a secondary data source based off of your first drop-down list. This should work fine with an OnChange event. Can you post the code you are using to do this?
Some additional tips that may help:
The change event will not fire until focus moves off of the list box. So, for the second drop down to populate, you will need to set the first drop-down then hit tab or click elsewhere in the form.
I don't know the size or nature of the data source you are using for the second drop-down list, but you may consider downloading the entire data source and filter it using the method I described above. This may be a better solution as you won't need to make a database query between entering the first list box and the second one.

Resources