Updates doesn't work in "composite:implementation"

UI Components for JSF
Post Reply
makoto1337
Posts: 82
Joined: 10 Dec 2009, 10:17

13 Jan 2010, 02:52

JSF has the ability to easily create components using the composite:implementation interface. However, inside the components made this way, using primefaces components has proven to be problematic. For example, if you want to update some text using a primefaces "update" tag, it doesn't work. For example, if you have the following code:

Code: Select all

<h:panelGrid columns="2">
            <h:outputText value="Rate This Project" />
            <p:rating rateListener="#{ratingController.handleRate}" update="display"/>
         </h:panelGrid>
         <h:outputText id="display" value="#{ratingController.message}" />
Then you always get an error message like: "org.primefaces.application.PrimeFacesPhaseListener|_ThreadID=26;_ThreadName=Thread-1;|Component "display" not found to be updated partially." This always happens inside composite:implementations, across many components (p:rating, p:tree, etc.).

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

13 Jan 2010, 10:29

Actually, composite component implements NamingContainer. Try this update="'#{cc.clientId}:display" instead of update="display" (as workaround).
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

14 Jan 2010, 11:29

Any news? I believe, my suggestion doesn't work. Is it a PrimeFaces issue?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jan 2010, 11:53

update="'#{cc.clientId}:display" should work, also upcoming version of PrimeFaces can work with server ids as well.

Guillaume.Dosser
Posts: 5
Joined: 27 Jan 2010, 01:51

07 Feb 2010, 15:22

Hello,

I am wondering is there is a method that provide the the generated id of a component from the id put in the JSF

for instance :
<p:commandButton
id="button"
value="Click"
actionListener="#{button.onSubmit}"
/>
will generate an id : j_idt5:j_idt8:button_submit

I found a class that provide a method to get the id : http://illegalargumentexception.blogspo ... fiers.html

But it should be better to integrate it directly in Primefaces. Maybe it is the case but i did not find any documentation about it.

Regards,

Guillaume

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Feb 2010, 15:56

But j_idt5:j_idt8:button_submit is the request parameter name to mark button as submitted. Client id of the button would be _idt5:j_idt8 actually. What is your use case?

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

07 Feb 2010, 16:28

Hi,

A function like rich:component in RichFaces returning clientId of any component would be very useful if we work with JavaScript. What is about p:component? as new feature :-)
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Feb 2010, 16:31

Well it is very easy to implement, why not :)

#{prime:component('server_id')} ?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Feb 2010, 17:25

Ok done, added PrimeFaces facelets helper functions. Right now we only have component function to get client id of a component given by the server id.

Code: Select all

#{p:component('name')}
will give something like "form:name"

Related issue: http://code.google.com/p/primefaces/iss ... ail?id=501

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests