25

I am attempting to create a backend module, wherein on my edit page I use admin-2column-left layout. I want to have a form on each tab, but I do not understand how I can do this. Ideally, I would like to know how to assign different form uiComponents to different tabs, or how I can define one uiComponent for my form, but be able to assign which field set goes on which tab.

My specific situation, which provokes this question, is that I want to have a standard form on one tab (multiple text inputs), and on another tab, I want to have a dynamicRows UI component. We have called these tabs Main and Line Items.

Currently, I am implementing this as follows: Main is defined in the _prepareForm method within its block, which is a class extension Form\Generic. This form appears and works fine until I add the dynamic rows.

My layout file has code to add the Main tab and assign content block. As well it has a container named line_items, which contains a uiComponent for the form containing dynamic rows.

The Line Items tab is created in the _beforeToHtml method of the Widget\Tab, and its content is assigned by using a call to getChildHtml on a line_items container. The tab works and is populated with the correct structure, allowing me to add and remove rows.

The issue is that when I submit the page, only the inputs in the Line Items tab are submitted. So I know I have not set this up correctly, and need some way to instruct it to track and submit all the form elements. Most of this implementation is derived from my attempts to reverse engineer the setup of the Category Product Attributes form, which is similar to what I want to do.

  • Did you ever figure this out? – jamil Feb 19 '18 at 22:51
  • 1
    Stephen - I am assuming that you have found a solution after all this time? If so can you please update this with your solution? – brentwpeterson Mar 11 '18 at 13:45
  • @Stephen Fritz - Could you please provide an screenshot how do you looking for ? – Praful Rajput Apr 6 '18 at 11:18
  • May I ask whether this question still needs an answer? If it does, I might verify I understand the problem: are we trying to build a backend screen with separate forms in it? or is a screen with multiple tabs (uiComponent fashion) be a solution to this issue? – Herve Tribouilloy Jun 18 '18 at 11:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.