Dynaform error with javax.faces.PARTIAL_STATE_SAVING = false

Community Driven Extensions Project
Post Reply
jibanez
Posts: 4
Joined: 09 Jan 2017, 18:24

23 May 2017, 14:43

Hello,

We have the following problem with the dynaForm and dynaFormControl components. Using them with the context-param "javax.faces.PARTIAL_STATE_SAVING" activated (true) in web.xml, it works fine.

In a situation where this context-param (javax.faces.PARTIAL_STATE_SAVING) is set to false we get the following error when we try to submit the form with the dynamic components: java.lang.IllegalStateException: Duplicate component ID _NMQS000C_WAR_NMQS000C_:form1:dynaform:j_idt22 found in view.

We cannot set the context-param to true, so what we can do to avoid the duplicate ID?

Any suggestion to solve our problem will be appreciate!


We are working with:
Mojarra 2.1.28-jbossorg-6
JBoss EAP 6.4
Primefaces 4.0
PrimeFaces Extensions 1.2.1
Liferay 6

This is the XHTML (reduced version) we are working with:


<p:tab title="Prueba">

<pe:dynaForm id="dynaform" value="#{pc_PruebaOficinaVirtual.listModel[0]}" var="data">

<pe:dynaFormControl type="TEXTBOX">

<h:panelGroup layout="block" styleClass="bide-ancho4de12" >
<p:outputLabel value="#{data.label}" id="labelTextBox" for="textbox" rendered="#{data.rendered}"/>
<p:inputText id="textbox" value="#{data.value}"
required="#{data.required}"
requiredMessage="Campo obligatorio"
rendered="#{data.rendered}"
style="width:#{data.tamanio}px"/>
<p:message for="textbox" id="message" rendered="#{data.rendered}"/>
</h:panelGroup>

</pe:dynaFormControl>

<f:facet name="buttonBar">
<p:commandButton id="button" rendered="false" process="@form"
actionListener="#{pc_PruebaOficinaVirtual.upload}"
ajax="false"
value="Guardar"
action="#{pc_PruebaOficinaVirtual.submitForm(0)}" />

<p:commandButton id="ajaxButton" rendered="true" process="@form"
ajax="#{tabItem.ajax}"
value="Guardar"
action="#{pc_PruebaOficinaVirtual.submitForm(0)}"
update="@form" />
</f:facet>

</pe:dynaForm>

</p:tab>


This is the reduced stacktrace:

Reduced StackTrace:
java.lang.IllegalStateException: Duplicate component ID _NMQS000C_WAR_NMQS000C_:form1:dynaform:j_idt22 found in view.
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:879)
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:863)
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:863)
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:863)
at com.sun.faces.util.Util.checkIdUniqueness(Util.java:863)
at com.sun.faces.application.view.FaceletFullStateManagementStrategy.saveView(FaceletFullStateManagementStrategy.java:697)
at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:89)
at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:225)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:464)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
at com.liferay.faces.bridge.application.ViewHandlerCompatImpl.renderView(ViewHandlerCompatImpl.java:52)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:227)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:85)
at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:112)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:255)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:204)
at javax.portlet.GenericPortlet.r...


and the trace of the JSF component tree:


+id: j_idt21
type: org.primefaces.component.tabview.Tab@8ff938
+id: dynaform
type: org.primefaces.extensions.component.dynaform.DynaForm@330336
+id: j_id2
type: javax.faces.component.UIPanel@117ff91
+id: button
type: org.primefaces.component.commandbutton.CommandButton@8ba3d2
+id: ajaxButton
type: org.primefaces.component.commandbutton.CommandButton@1b04e05
+id: j_idt22 <===============
type: org.primefaces.extensions.component.dynaform.UIDynaFormControl@1d23d97
+id: j_idt23
type: javax.faces.component.html.HtmlPanelGroup@1c9b292
+id: labelTextBox
type: org.primefaces.component.outputlabel.OutputLabel@eacdb5
+id: textbox
type: org.primefaces.component.inputtext.InputText@1673b0f
+id: message
type: org.primefaces.component.message.Message@567e83
+id: j_idt22 <===============
type: org.primefaces.extensions.component.dynaform.UIDynaFormControl@8bcba7
+id: j_idt23
type: javax.faces.component.html.HtmlPanelGroup@1e780d2
+id: labelTextBox
type: org.primefaces.component.outputlabel.OutputLabel@1ba7abe
+id: textbox
type: org.primefaces.component.inputtext.InputText@1d06559
+id: message
type: org.primefaces.component.message.Message@adbf32
+id: j_idt24
type: javax.faces.component.html.HtmlPanelGroup@e37011

tandraschko
PrimeFaces Core Developer
Posts: 3266
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

23 May 2017, 17:09

Why you can't set it to true? IMO setting is to false doesn't make sense. Partial state saving saves memory.
Always Bet On Prime (+ Extensions)!

Thomas Andraschko
PrimeFaces Developer | PrimeFaces Extensions Founder
Apache OpenWebBeans PMC | Apache DeltaSpike PMC | Apache MyFaces PMC

Personal Blog: http://tandraschko.blogspot.de/

jibanez
Posts: 4
Joined: 09 Jan 2017, 18:24

23 May 2017, 18:10

Hello,

Yes. Our Facelet (pruebaOficinaVirtual.xhtml) is deployed as a JBoss Static Module and it is included in another XHTML of a Liferay Portlet, like this:

Code: Select all

 <ui:include src="/vistas/estaticos/solicitud/pruebaOficinaVirtual.xhtml" />
We are the owner of the JBoss Static Module but not of de Liferay Portlet, and the web.xml file is on the Portlet, so thats the reason why we can not change this parameter to true.

I dont know why the IDs of the dynaFormControl objects are duplicated when this parameter is set to false, but is there any solution or workaround to avoid this error? Thank you!

User avatar
Melloware
Posts: 337
Joined: 22 Apr 2013, 15:48

24 May 2017, 12:28

I would report this error on our GitHub Issues page.

https://github.com/primefaces-extension ... com/issues
PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces 6.1.X / PF Extensions 6.1.5

jibanez
Posts: 4
Joined: 09 Jan 2017, 18:24

24 May 2017, 13:27

I have just reported this error on your GitHub Issues page,

https://github.com/primefaces-extension ... issues/460

Hope you can fix this error. Thank you very much!!

tandraschko
PrimeFaces Core Developer
Posts: 3266
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

24 May 2017, 13:45

It could also be a Mojarra bug - so feel free to try MyFaces ;)
Always Bet On Prime (+ Extensions)!

Thomas Andraschko
PrimeFaces Developer | PrimeFaces Extensions Founder
Apache OpenWebBeans PMC | Apache DeltaSpike PMC | Apache MyFaces PMC

Personal Blog: http://tandraschko.blogspot.de/

jibanez
Posts: 4
Joined: 09 Jan 2017, 18:24

24 May 2017, 16:19

Sorry, but in our case we can not change the JSF implementation. Also our Facelets are deployed into a JBoss static module.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests