Design Discussions

Community Driven Extensions Project
Post Reply
tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

13 Mar 2012, 11:25

yep, of course :)
If you have time, why not :)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

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

13 Mar 2012, 15:28

Invent use cases for jQuery selector based process/ update attributes is difficult because process / update are normally component based. Otherwise JSF standard or other comp. libs would had this a long time ago ;)

What I would like to see in PrimeFaces are "extension points". I have created here an issue about pe:dataStorage http://code.google.com/p/primefaces-ext ... tail?id=21 This is one of possible extension points. While iteration over child elements we could check some interface and call extend() or whatever on this interface. In case of pe:dataStorage we need to save the state of row, cell, node, menu item, whatever on the client side. The aim is to avoid ajax requests. Use case is e.g. menus depending on selected row(s) / node. Client side data can be saved via jQuery .data(key, value). Using example for tree:

Code: Select all

<p:tree value="#{treeBean.root}" var="node">
   <pe:dataStorage value=#{node.data.jsonNodeData} />  // bound client side data to tree node
   <p:treeNode>
      <h:outputText value="#{node}"/>
   </p:treeNode>
</p:tree>
DataTable:

Code: Select all

<p:dataTable ... var=row"/>
   <pe:dataStorage value=#{row.jsonRowData} />  // bound client side data to tr element (row)
   <p:column>
       <pe:dataStorage value=#{row.car.jsonCarData} />  // bound client side data to td element (cell)
       ...
   </p:column>
   ...
</p:dataTable>
Widgets should offer a method, say getDataStorageForSelectedObjects(), which returns stored client side data.

Code: Select all

   var ds = myWidget.getDataStorageForSelectedObjects();
   for (var i = 0; i < ds.length; i++) {
       // iterate over all data for current selected objects
       ...
   }
The example is just a thought, perhaps a simple component attribute to expose client-side data is better. Because pe:dataStorage is good to render HTML attributes, but not to store data into JS objects.
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 Mar 2012, 10:41

Regarding partialSubmit. If all showcases work fine with this feature and performance is ok, we can set it as default, I think. This should be good tested before.
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:

28 Mar 2012, 11:30

Hi guys,

Any suggestions on PrimeFaces Push, I'd like to re do it with atmosphere.

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

28 Mar 2012, 11:46

Hello heisen..., Cagatay,

What kind of suggestions do you need? Atmosphere is a good choice. Go ahead.

You know my article where I tried to do server push with Atmosphere. I have positive experience with Atmosphere-Jersey "friendship". No luck with Atmosphere-Meteor. What is the current version of Atmosphere? In 0.7 / 0.8-SNAPSHOT were some bugs, it was not possible to use the same Atmosphere version with all supported protocols.

By the way, I saw PrimeFaces specific code in AtmosphereServlet :-) This code should be removed because it doesn't work with Atmosphere-Jersey. This was last time I worked with Atmosphere, I didn't work more than half year with it.

Cheers. Oleg.
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

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

28 Mar 2012, 12:30

Hey,

Athmosphere sounds great but i dont like jersey intergration or else. Servlet or Filter would be cool.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

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

28 Mar 2012, 13:41

I meant Servlet. I meant with Jersey not a RESTful stuff, etc., but a quite normally Java class. I used Jersey and its annotations (@GET, @POST und @PATH) to catch requests for the certain Topic-URL in a declarative way. All what you need is this dependency

Code: Select all

<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-jersey</artifactId>
and some init-params in web.xml for AtmosphereServlet. Nothing specific. This is lightweight. More lightweight and flexible than Meteor in my opinion. And it works well at least :-)
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

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

28 Mar 2012, 13:54

Jep but this required to add Jersey or JAX-RS right?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

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

28 Mar 2012, 14:15

Yes, atmosphere-jersey dependency adds jersey-core-xyz.jar and jersey-server-xyz.jar files (transitive dependencies). Is it a problem?
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

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

28 Mar 2012, 14:38

Yep, we use CFX. I would never include Jersey, too.
Also Servlet's are available on every AS, Jersey not.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests