Foros de discusión
Using Partial Processing with Primefaces + Liferay
Kamesh Sampath, modificado hace 10 años.
Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
Hi,
I am kind of building an example, wherein i am trying to use the Primefaces partial processing where selecting item from one box will refresh the items form the other box.
the code is as below,
But am always getting an error saying "Cannot find component with identifier "envTypes" referenced from "A4488:j_idt5:j_idt6:l1:f1:fs1:c1a:project"."
Can anyone tell me what is wrong with my approach ?
Thank you.
Kamesh
I am kind of building an example, wherein i am trying to use the Primefaces partial processing where selecting item from one box will refresh the items form the other box.
the code is as below,
<aui:layout id="l1">
<h:form id="f1">
<p:messages autoUpdate="true" />
<aui:fieldset id="fs1">
<aui:column id="c1a">
<aui:field id="projectField" label="#{i18n['w7.mgmt.project']}">
<p:selectonemenu id="project" label="#{i18n['w7.mgmt.project']}" required="true" value="#{w7ModelBean.project}">
<f:selectitems value="#{w7ModelBean.projects}" />
<f:ajax render="projectField" />
<p:ajax event="change" listener="#{w7ModelBean.handleProjectChange}" update="envTypes" />
</p:selectonemenu>
<p:message id="projectFieldMessage" for="project" />
</aui:field>
</aui:column>
<aui:column id="c1b">
<aui:field id="envTypeField" label="#{i18n['w7.mgmt.environment.types']}">
<p:selectonemenu id="envTypes" label="#{i18n['w7.mgmt.environment.types']}" required="true" value="#{w7ModelBean.envType}">
<f:selectitems value="#{w7ModelBean.environmentTypes}" />
<f:ajax render="envTypeField" />
</p:selectonemenu>
<p:message id="envTypeFieldMessage" for="envTypes" />
</aui:field>
</aui:column>
</aui:fieldset>
</h:form>
</aui:layout>
But am always getting an error saying "Cannot find component with identifier "envTypes" referenced from "A4488:j_idt5:j_idt6:l1:f1:fs1:c1a:project"."
Can anyone tell me what is wrong with my approach ?
Thank you.
Kamesh
Juan Gonzalez, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Can you tell us your environment? (Liferay Faces and primefaces versions, etc)?
My guess is that you're using that code inside a NamingContainer.
EDIT: confirmed, AUI:Layout is a NamingContainer so you should reference id using the absolute path (not relative) for them (separate by semicolon ":").
My guess is that you're using that code inside a NamingContainer.
EDIT: confirmed, AUI:Layout is a NamingContainer so you should reference id using the absolute path (not relative) for them (separate by semicolon ":").
Kamesh Sampath, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
Hi,
thanks for the response, I use Liferay Portal 6.1.1-ce-ga2 with Liferay Faces 3.1.2.ga3 and Prime faces 3.5
when you say absolute path you mean right form the form like l1:f1:fs1:c1b:envTypeField:envTypes( referring to the same code), but I tried doing it and kind of getting the same error message, I might be wrong though
thanks for the response, I use Liferay Portal 6.1.1-ce-ga2 with Liferay Faces 3.1.2.ga3 and Prime faces 3.5
when you say absolute path you mean right form the form like l1:f1:fs1:c1b:envTypeField:envTypes( referring to the same code), but I tried doing it and kind of getting the same error message, I might be wrong though
Neil Griffin, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
If you prefix it with a colon, then it will start searching from UIViewRoot I believe, like this: ":l1:f1:fs1:c1b:envTypeField:envTypes"
Kamesh Sampath, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
I tried even doing that , for some reason its not able to pick the field up .. is there any other alternate way to make the refresh happen ?
In addition to this I am not able to cross refer the components using their ids,
e.g
UI Composition 1 - x.xhtml
------------------------------------
<h:form id="f1">
<p:treeTable id="x">
....
<p:ajax event="select" process="@form" update="f2:y"/>
</p:treeTable>
</h:form>
UI Composition 2 - y.xhtml
------------------------------------
<h:form id="f2">
<p:tabView id="y">
....
</p:tabView>
</h:form>
view.xhtml
--------------
...
<ui:include src="x.xhtml" />
<br/>
<ui:include src="y.xhtml" />
...
I then get the usual component not found error
Any thoughts .. i even tried using the binding attribute and get the id using the binding attribute still face the same issue.
--Kamesh
In addition to this I am not able to cross refer the components using their ids,
e.g
UI Composition 1 - x.xhtml
------------------------------------
<h:form id="f1">
<p:treeTable id="x">
....
<p:ajax event="select" process="@form" update="f2:y"/>
</p:treeTable>
</h:form>
UI Composition 2 - y.xhtml
------------------------------------
<h:form id="f2">
<p:tabView id="y">
....
</p:tabView>
</h:form>
view.xhtml
--------------
...
<ui:include src="x.xhtml" />
<br/>
<ui:include src="y.xhtml" />
...
I then get the usual component not found error
Any thoughts .. i even tried using the binding attribute and get the id using the binding attribute still face the same issue.
--Kamesh
Juan Gonzalez, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hi Kamesh,
I remember there was an issue when using components and referencing id with Primefaces (unfortunately I don't find the link to the Primefaces issue).
Please can you re-test the same but without using Primefaces? (only using <f:ajax/> and the like).
I remember there was an issue when using components and referencing id with Primefaces (unfortunately I don't find the link to the Primefaces issue).
Please can you re-test the same but without using Primefaces? (only using <f:ajax/> and the like).
Kamesh Sampath, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
Hi Juan,
I see this problem coming only when i put my fileds within <aui:field/>, if I dont use the aui containers I am able to refer the id, but still sometime it gives an issue during hot deploy or refresh but it solved when I restart the server
I see this problem coming only when i put my fileds within <aui:field/>, if I dont use the aui containers I am able to refer the id, but still sometime it gives an issue during hot deploy or refresh but it solved when I restart the server
Neil Griffin, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Kamesh,
I was able to reproduce the problem you mentioned regarding children of aui:field and realized that we might need to remove "implements UINamingContainer" from many of our components. Please see the thread titled Community Feedback Requested: Removing NamingContainer from aui: components for more info. The feedback we get on that thread will help us to determine the best course of action.
Thanks,
Neil
I was able to reproduce the problem you mentioned regarding children of aui:field and realized that we might need to remove "implements UINamingContainer" from many of our components. Please see the thread titled Community Feedback Requested: Removing NamingContainer from aui: components for more info. The feedback we get on that thread will help us to determine the best course of action.
Thanks,
Neil
Bernd Prager, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Junior Member Mensajes: 42 Fecha de incorporación: 20/12/12 Mensajes recientes
How about putting the portlet namespace in your view?
Now you have the portlet namespace availabe and can use it like this:
<f:view xlmns="http://www.w3.org/1999/xhtml
...
xmlns:portlet=" http: java.sun.com portlet"></f:view>
Now you have the portlet namespace availabe and can use it like this:
<p:commandbutton value="Submit" update="<portlet:namespace />:msgs" />
Vernon Singleton, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Expert Mensajes: 315 Fecha de incorporación: 14/01/13 Mensajes recientes
One of my guru friends says that you can do this:
In order to allow Facelets to parse the view xhtml.
<portlet:namespace var="namespace" />
<p:commandbutton value="Submit" update="#{namespace}:msgs" />
In order to allow Facelets to parse the view xhtml.
Juan Gonzalez, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hi Kamesh,
good news! I finally managed to solve the issue.
It was simply a matter of prefixing the id with all the parent naming containers, so finally it looks like this:
So the trick is this text:
I've attached a sample portlet with all the code (it's done from primefaces-portlet demo with few changes).
BTW, I couldn't make it work when updating envTypeField:envTypes.
Thanks!
good news! I finally managed to solve the issue.
It was simply a matter of prefixing the id with all the parent naming containers, so finally it looks like this:
<p:ajax event="change" listener="#{namingRequestBean.handleProjectChange}" update=":#{component.namingContainer.parent.namingContainer.clientId}:c1b:envTypeField" />
So the trick is this text:
#{component.namingContainer.parent.namingContainer.clientId}
I've attached a sample portlet with all the code (it's done from primefaces-portlet demo with few changes).
BTW, I couldn't make it work when updating envTypeField:envTypes.
Thanks!
Archivos adjuntos:
Kamesh Sampath, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
That's ! awesome Juan thanks for the update. Let me check it out
Neil Griffin, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Kamesh,
Did the workaround provided by Juan help?
Thanks,
Neil
Did the workaround provided by Juan help?
Thanks,
Neil
Neil Griffin, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Also, we recently closed FACES-1643 since we have decided to remove NamingContainer from aui: components in Liferay Faces 4.1.x/4.2.x. For more info, see: FACES-1688.
Kamesh Sampath, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
I haven't tried it, since it gave error earlier I did resort to the plain primefaces based ui and containers for my implementation. Will try and keep you posted
-Kamesh
-Kamesh
Juan Gonzalez, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay (Respuesta)
Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hi Kamesh,
I tried more less the same test (using p:commandLink instead, but the component resolution process should be the same), and seems to be working using Primefaces 4.0 and latest Liferay Faces.
Can you check it?
Thanks!
I tried more less the same test (using p:commandLink instead, but the component resolution process should be the same), and seems to be working using Primefaces 4.0 and latest Liferay Faces.
Can you check it?
Thanks!
Kamesh Sampath, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Mensajes: 158 Fecha de incorporación: 27/05/10 Mensajes recientes
Sorry for the delayed reply Juan, it did work with PrimeFaces 4. Thanks.
Juan Gonzalez, modificado hace 10 años.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Thanks for confirming Kamesh,
could you mark the answer so anyone who reads this can see the solution quickly?
Thanks again.
could you mark the answer so anyone who reads this can see the solution quickly?
Thanks again.