Foren
Using Partial Processing with Primefaces + Liferay
Kamesh Sampath, geändert vor 10 Jahren.
Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Junior Member Beiträge: 42 Beitrittsdatum: 20.12.12 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Expert Beiträge: 315 Beitrittsdatum: 14.01.13 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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!
Anhänge:
Kamesh Sampath, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
That's ! awesome Juan thanks for the update. Let me check it out
Neil Griffin, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Hi Kamesh,
Did the workaround provided by Juan help?
Thanks,
Neil
Did the workaround provided by Juan help?
Thanks,
Neil
Neil Griffin, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay (Antwort)
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
Sorry for the delayed reply Juan, it did work with PrimeFaces 4. Thanks.
Juan Gonzalez, geändert vor 10 Jahren.
RE: Using Partial Processing with Primefaces + Liferay
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
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.