Extra-Fields - Class Inheritance in Fabrik

marcelf

Member
Hi all,
Sometimes in a form, you need to show new fields when the user selects a choice. Or you need to represent class inheritance. Look at the example below.
View attachment 17470
What I want: I created 3 lists: Employee List, Regular Employee, And Contract Employee. The user starts to fill out the form.
View attachment 17472
When he selects Regular Employee, the form by AJAX retrieve and shows its form with its elements (a form inside parent form).

View attachment 17473

Is it possible to do this nowadays? If not, what you thing about to create a Conditional or Sub List Element Plugin? Do you think its possible without change fabrik core?

PS: This is similar to a Class Inheritance in Doctrine, look:
https://www.doctrine-project.org/pr...ritance-mapping.html#single-table-inheritance
https://martinfowler.com/eaaCatalog/classTableInheritance.html
https://www.slideshare.net/HermanPeeren/jooctrine-doctrine-orm-in-joomla
View attachment 17471
I became curious about this jooctrine.org - Doctrine ORM in Joomla - and its possible relationship with Fabrik
 
You can hide and show groups or elements (onLoad, onChange...) via JS depending on an element value (built-in functions in element settings).
 
It's not perfect, but as @troester says, you can approximate it with JS hide/show. Join the "regular" and "contract" tables to your Employees list with a one-to-one (not repeating) join (so from employee.id to regular.employee_id / contract.employee_id), which gives you those two groups on the employee form, and hide/show as necessary.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top