-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 7.10, 8.3
-
Component/s: Seam / JSF UI
- in studio create a form layout
- choose one layout (for example the edit layout)
- add 2 containers
- add a widget inside each of them
- create a tab with a toggleable form that will display this form
- sync with the server
- try to access the form by clicking the tab
- 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
- See attached project to reproduce the issue.
- Also, if studio access is needed, check project ffischer-710 with tag SUPNXP18045002