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

Mutli-Column Form with SubForm and Ajax

Discussion in 'Fabrik 3.x Testing' started by peterk900, May 19, 2012.

  1. peterk900

    peterk900 Member

    Level: Community
    Is it possible to produce a form along the lines of the attached image ?

    I know some parts are possible as I've looked at the videos but I'm not sure if all is possible. So any pointers, ideally to a similar example , would be good.

    I see it working like this:

    This form sits on a page with text above and below. I can handle this.

    Part 1 of form

    A combo box is filled from an external table view which has a bound field ( hidden ) giving a client number and then displays detail about the client - Company, Contact name and Ledger Balance. I can fill a combo - based on the video tutorial.

    When the user select an item from the combo Parts 2 and 3 are displayed using the combo bound field - ideally via Ajax so that the rest of the page does not refresh. Not sure about this !

    Part 2 of Form

    Full Address (multi-line text box) on LHS with 3 fields on RHS e.g Phone, Email, Web Address. This is a 2 column display. I know you can do this via Groups but I haven't found a 2 or 3 column form example.

    So far all this data could come from a MySQL view - the combo string and the detail for the text boxes below.

    Part 3 of the Form

    This will come from a client contact table detailing each activity relating to the client. This information should be as a normal list with view and amend buttons. The list should contain a selection of elements and the form which is displayed when the view or amend icon is clicked should, if possible contain additional elements - i.e the list is a sub-set of the elements displayed on the form.

    As with a normal list and add new button should be present to allow addtional client contact entries to be added.

    A mock up of the form is attached.

    Is this possible ? Or if not, where do I have to compromise ? If so any help to get me started would be appreciated.

    Thanks

    Peter
     

    Attached Files:

  2. lutana

    lutana New Member

    Level: Standard
    From the limited knowledge I have it would seem Part 1 & 2 are very doable the problem is Part 3 which I am yet to be able to sort out/find a solution to. Search the forum for something like "list form" and you will see threads on it. I am on to another idea (but don't hold much hope) ... but if it does ever work I will certainly let people know.
     
    1 person likes this.
  3. Jaanus

    Jaanus Super Moderator

    Level: Community
    Showing list inside form/details is possible using Fabrik content plugin. It have to be allowed to process in form/details/both (in form admin). Here in Fabrik3 it's enough if you just create special group for it without elements. In group intro you can enter the list code {fabrik view=list id=somenumber tablename___fieldname=[rowid]}
    somenumber you replace with a real list id, e.g id=12, tablename is the db table that list with this id points... etc
     
    1 person likes this.
  4. lutana

    lutana New Member

    Level: Standard
    I should have said that I dont believe 3 can be done if you want to be able to update the data in the elements in Part 2 of the form (from this form) ... which in your case might not be an issue.
     
  5. peterk900

    peterk900 Member

    Level: Community
    Thanks for your ideas and help.

    My sketch is misleading - sorry - the detailed listing ( Client ID... Address) should show a different table - keyed on Client ID but not the same one as the combo box ! This detailed table shows contact data - i.e phone calls, visits, proposals etc relating to the client.

    Lutana was right I suspect - to try and edit the same table as appeared in the selection box wouldn't make sense !

    I think I'm there with Parts 1 and 3 because this is really the same as the tutorial - Digging Deeper - Table Filtering. And I've modified permissions to allow add/amend/delete of contact data. And you can loop back and forth - change the combo value and you see an new set of records for the new client.

    But I'm stuck on the middle bit - how can I display some additional information from the same table/view which fills the combo - and show this below the combo and above the table ?

    Jaanus - Are you saying that "the form" is the combo and the details and then you insert the List inside this with the Fabrik content plugin ?
    But how do I pass the list the Client ID from the combo box ? I note you say create a group with no elements and enter a list reference {fabrik view=list id=somenumber tablename___fieldname=[rowid]}. Presumably the form for the group is the form holding the combo and the detailed data ? And the list reference goes in the intro text area ? And where do I specify this plug in ?

    I've attached another print sample - once again sorry about the mistake on the other form, and thanks for you help so far.

    Peter
     

    Attached Files:

  6. Jaanus

    Jaanus Super Moderator

    Level: Community
    Form view is editable, details view is the same but readonly.
    The form for the group is the form holding the combo (and the detailed data, although in Fabrik it would be rather a table join from this table to the table with detailed data). And yes, list is inside this form.

    Instead [rowid] that is this forms pk value you can use the id of the "combo" [yourcurrenttablename___thiselementname] as I suppose its value is your client id.

    But what you want to do... congratulations :p For this you have to do many hocuspocuses with table joins, fields of type cascacingdropdown (that have some weird bugs in moment, I hope the Fabrik developers will find what's going on) or calc, javascript, eval codes behind elements and so on. I have some ideas to make something similar but not tryed yet.

    You have to test and learn and fail and test and learn and fail again and learn and learn... mostly independently.
     
    1 person likes this.
  7. peterk900

    peterk900 Member

    Level: Community
    Thanks for this input. I think you are right - its a matter of experiment - I'll try out what I think you are suggesting - and post an update on what comes out.

    Thanks again

    Peter
     
  8. maxinic

    maxinic Member

    Level: Community

    could you explain in detail how to create a combobox that I did not understand?
     
  9. Jaanus

    Jaanus Super Moderator

    Level: Community
    Actually here I explained how (and where) to display list view inside form/details view.
     

Share This Page