Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Using Partial Processing with Primefaces + Liferay Kamesh Sampath June 28, 2013 12:45 AM
RE: Using Partial Processing with Primefaces + Liferay Juan Gonzalez June 28, 2013 12:58 AM
RE: Using Partial Processing with Primefaces + Liferay Kamesh Sampath June 28, 2013 3:26 AM
RE: Using Partial Processing with Primefaces + Liferay Neil Griffin June 28, 2013 6:27 AM
RE: Using Partial Processing with Primefaces + Liferay Kamesh Sampath June 29, 2013 9:59 PM
RE: Using Partial Processing with Primefaces + Liferay Juan Gonzalez July 1, 2013 8:57 AM
RE: Using Partial Processing with Primefaces + Liferay Kamesh Sampath July 5, 2013 6:45 AM
RE: Using Partial Processing with Primefaces + Liferay Neil Griffin July 19, 2013 8:19 AM
RE: Using Partial Processing with Primefaces + Liferay Bernd Prager October 9, 2013 6:49 AM
RE: Using Partial Processing with Primefaces + Liferay Vernon Singleton October 9, 2013 7:12 AM
RE: Using Partial Processing with Primefaces + Liferay Juan Gonzalez July 22, 2013 3:53 AM
RE: Using Partial Processing with Primefaces + Liferay Kamesh Sampath July 22, 2013 5:33 AM
RE: Using Partial Processing with Primefaces + Liferay Neil Griffin August 12, 2013 3:33 PM
RE: Using Partial Processing with Primefaces + Liferay Neil Griffin August 12, 2013 3:50 PM
RE: Using Partial Processing with Primefaces + Liferay Kamesh Sampath August 12, 2013 7:46 PM
RE: Using Partial Processing with Primefaces + Liferay Juan Gonzalez October 9, 2013 12:58 AM
RE: Using Partial Processing with Primefaces + Liferay Kamesh Sampath December 30, 2013 1:37 AM
RE: Using Partial Processing with Primefaces + Liferay Juan Gonzalez December 30, 2013 1:56 AM
Kamesh Sampath
Using Partial Processing with Primefaces + Liferay
June 28, 2013 12:45 AM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

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,

 1
 2<aui:layout id="l1">
 3        <h:form id="f1">
 4            <p:messages autoUpdate="true" />
 5            <aui:fieldset id="fs1">
 6                <aui:column id="c1a">
 7                    <aui:field id="projectField" label="#{i18n['w7.mgmt.project']}">
 8                        <p:selectOneMenu id="project" label="#{i18n['w7.mgmt.project']}"
 9                            required="true" value="#{w7ModelBean.project}">
10                            <f:selectItems value="#{w7ModelBean.projects}" />
11                            <f:ajax render="projectField" />
12                            <p:ajax event="change" listener="#{w7ModelBean.handleProjectChange}" update="envTypes"/>
13                        </p:selectOneMenu>
14                        <p:message id="projectFieldMessage" for="project" />
15                    </aui:field>
16                </aui:column>
17
18                <aui:column id="c1b">
19                    <aui:field id="envTypeField"
20                        label="#{i18n['w7.mgmt.environment.types']}">
21                        <p:selectOneMenu id="envTypes"
22                            label="#{i18n['w7.mgmt.environment.types']}" required="true"
23                            value="#{w7ModelBean.envType}">
24                            <f:selectItems value="#{w7ModelBean.environmentTypes}" />
25                            <f:ajax render="envTypeField" />
26                        </p:selectOneMenu>
27                        <p:message id="envTypeFieldMessage" for="envTypes" />
28                    </aui:field>
29                </aui:column>
30            </aui:fieldset>
31        </h:form>
32    </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
RE: Using Partial Processing with Primefaces + Liferay
June 28, 2013 12:58 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1931

Join Date: October 28, 2008

Recent Posts

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 ":").
Kamesh Sampath
RE: Using Partial Processing with Primefaces + Liferay
June 28, 2013 3:26 AM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

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 emoticon
Neil Griffin
RE: Using Partial Processing with Primefaces + Liferay
June 28, 2013 6:27 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2097

Join Date: July 26, 2005

Recent Posts

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
RE: Using Partial Processing with Primefaces + Liferay
June 29, 2013 9:59 PM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

I tried even doing that , for some reason its not able to pick the field up emoticon .. 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
Juan Gonzalez
RE: Using Partial Processing with Primefaces + Liferay
July 1, 2013 8:57 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1931

Join Date: October 28, 2008

Recent Posts

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).
Kamesh Sampath
RE: Using Partial Processing with Primefaces + Liferay
July 5, 2013 6:45 AM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

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
Neil Griffin
RE: Using Partial Processing with Primefaces + Liferay
July 19, 2013 8:19 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2097

Join Date: July 26, 2005

Recent Posts

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
Juan Gonzalez
RE: Using Partial Processing with Primefaces + Liferay
July 22, 2013 3:53 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1931

Join Date: October 28, 2008

Recent Posts

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:

1<p:ajax event="change" listener="#{namingRequestBean.handleProjectChange}"
2                            update=":#{component.namingContainer.parent.namingContainer.clientId}:c1b:envTypeField"/>


So the trick is this text:

1#{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!
Attachments: NamingContainer-portlet.zip (10,219.2k)
Kamesh Sampath
RE: Using Partial Processing with Primefaces + Liferay
July 22, 2013 5:33 AM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

That's ! awesome Juan emoticon thanks for the update. Let me check it out
Neil Griffin
RE: Using Partial Processing with Primefaces + Liferay
August 12, 2013 3:33 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2097

Join Date: July 26, 2005

Recent Posts

Hi Kamesh,

Did the workaround provided by Juan help?

Thanks,

Neil
Neil Griffin
RE: Using Partial Processing with Primefaces + Liferay
August 12, 2013 3:50 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2097

Join Date: July 26, 2005

Recent Posts

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
RE: Using Partial Processing with Primefaces + Liferay
August 12, 2013 7:46 PM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

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
Juan Gonzalez
RE: Using Partial Processing with Primefaces + Liferay
October 9, 2013 12:58 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1931

Join Date: October 28, 2008

Recent Posts

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!
Bernd Prager
RE: Using Partial Processing with Primefaces + Liferay
October 9, 2013 6:49 AM
Answer

Bernd Prager

Rank: Junior Member

Posts: 40

Join Date: December 20, 2012

Recent Posts

How about putting the portlet namespace in your view?
1<f:view
2  xlmns="http://www.w3.org/1999/xhtml
3  ...
4  xmlns:portlet="http://java.sun.com/portlet"
5>

Now you have the portlet namespace availabe and can use it like this:
1<p:commandButton value="Submit" update="<portlet:namespace />:msgs" />
Vernon Singleton
RE: Using Partial Processing with Primefaces + Liferay
October 9, 2013 7:12 AM
Answer

Vernon Singleton

LIFERAY STAFF

Rank: Regular Member

Posts: 172

Join Date: January 14, 2013

Recent Posts

One of my guru friends says that you can do this:

1<portlet:namespace var="namespace" />
2<p:commandButton value="Submit" update="#{namespace}:msgs" />


In order to allow Facelets to parse the view xhtml.
Kamesh Sampath
RE: Using Partial Processing with Primefaces + Liferay
December 30, 2013 1:37 AM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

Sorry for the delayed reply Juan, it did work with PrimeFaces 4. Thanks.
Juan Gonzalez
RE: Using Partial Processing with Primefaces + Liferay
December 30, 2013 1:56 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1931

Join Date: October 28, 2008

Recent Posts

Thanks for confirming Kamesh,

could you mark the answer so anyone who reads this can see the solution quickly?

Thanks again.