Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-20593

Fix proper handling of multiple containers inside a form layout

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Multiple containers inside a form layout are properly handled in the JSF UI.
    • Tags:
    • Backlog priority:
      500
    • Team:
      AT
    • Sprint:
      nxAT Sprint 9.3.9, nxAT Sprint 10.1.2, nxAT Sprint 10.1.3
    • Story Points:
      2

      Description

      1. in studio create a form layout
      2. choose one layout (for example the edit layout)
      3. add 2 containers
      4. add a widget inside each of them
      5. create a tab with a toggleable form that will display this form
      6. sync with the server
      7. try to access the form by clicking the tab
      8. the following trace is shown:
        2016-10-05 10:48:24,741 ERROR [http-bio-0.0.0.0-8080-exec-2] [nuxeo-error-log] javax.servlet.ServletException: Component ID nxl_tabTogLayout_tabLayout:nxw_sub0_toggledForm:nxl_myFormLayout_edit:nxw_sub0_headerForm has already been found in the view.
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
                at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
                at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
        

      When checking the extensions.xml file inside the project jar we can see the containers have 2 distinct names but the same widget id:

            <widget name="container" type="container">
              <labels>
                <label mode="any">Container</label>
              </labels>
              <translated>true</translated>
              <fields/>
              <controls mode="any">
                <control name="handleLabels">true</control>
              </controls>
              <subWidgets>
                <widget name="sub0" type="text">
                  <labels>
                    <label mode="any">My Custom Attr</label>
                  </labels>
                  <translated>false</translated>
                  <fields>
                    <field>testdocument:myCustomAttr</field>
                  </fields>
                </widget>
              </subWidgets>
            </widget>
            <widget name="container_1" type="container">
              <labels>
                <label mode="any">Container</label>
              </labels>
              <translated>true</translated>
              <fields/>
              <controls mode="any">
                <control name="handleLabels">true</control>
              </controls>
              <subWidgets>
                <widget name="sub0" type="text">
                  <labels>
                    <label mode="any">Source</label>
                  </labels>
                  <translated>false</translated>
                  <fields>
                    <field>dc:source</field>
                  </fields>
                </widget>
              </subWidgets>
            </widget>
      

      This means the container is not taken into account when computing the widget complete path:

      nxl_tabTogLayout_tabLayout:nxw_sub0_toggledForm:nxl_myFormLayout_edit:nxw_sub0_headerForm
      

      This is also reproductible with empty containers and setting the Show if empty option to Yes.

      This does not happen when setting layouts directly into the Document model and not using a FormLayout.
      The Studio generated xml is the same (both widgets are named sub0) but the generated id inside the xhtml has a _1 postfix dynamically appened to the second widget name:

      document_edit:nxl_layout_testDocument_edit:nxw_sub0_1

      1. See attached project to reproduce the issue.
      2. Also, if studio access is needed, check project ffischer-710 with tag SUPNXP18045002

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h