Design Discussions

Community Driven Extensions Project
Post Reply
cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Mar 2012, 10:20

This is a sticky topic to discuss collaboration between of PF core and PF extensions teams.

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

13 Mar 2012, 10:24

PartialSubmit Feature,

Hey Extensions team, I've added partialSubmit feature to PrimeFaces ajax core targeting 3.3. which is false by default. Assume you have 100 input fields in a form and you only process a particular one with @this. By default JSF and PF ajax serializes all fields and sends them in post body, when partialSubmit is true, only viewstate and the inputs related to the partially processed fields are serialized. This helps to reduce network load as the post message will be smaller, for large pages this helps and for small pages not much.

When you have time, please see line 552;

http://code.google.com/p/primefaces/sou ... ore.js#552

Feedback is welcome!

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

13 Mar 2012, 10:29

Hello Cagatay,

Many thanks. We already know about this optimization :-) We're tracking changes in SVN time to time. See this issue http://code.google.com/p/primefaces-ext ... ail?id=134

This is a good optimization. We're aware of that and will start with our work after 0.4.0. Keep you great work up!
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:

13 Mar 2012, 10:31

I also had to refactor impl code a bit to use jquery param which properly serializes the parameters. Glad to hear that you are monitoring the code base. Just a heads up, the params attribute in AjaxRequest is now an array like;

params: [{name:'x', value:10}, {name:'x', value:20}]

I'm also migrating :)

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

13 Mar 2012, 10:36

Another thing I'd like to discuss, I have this idea to integrate jquery selectors to JSF components to use in update and process, e.g.

Updates all input components under the panel.

Code: Select all

update="@('.ui-panel :input')"
Update all enabled inputs

Code: Select all

update="@(':input:not(:disabled)')"
There is no end to this, I think this is a cool feature, what do you think?

On the client side, I'll run the query to find the elements, get the component clientIDs from them and send them in ajax request.

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

13 Mar 2012, 10:44

params: [{name:'x', value:10}, {name:'x', value:20}] sounds good :-) Just don't use new Array() please. And don't call push() on array, or call it as less as possible. I was last week on a workshop "High Performance Websites" and learned that this works very slow. Instead of new Array() we should use JSON notation [......]. This is faster. Notations are always faster than function calls and w/o overhead. And instead of push() we can use this pattern:

Code: Select all

var myArray = [....];
myArray[myArray.length] = newElement;
Also jQuery $.each is very slow. Look this test please (even for small count of elements) http://jsfiddle.net/martinaglv/NcRsV/ Quite normally for() or while() loops are preferable.
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

13 Mar 2012, 10:52

Hi Cagatay,

Feature for update="@('.ui-panel :input')" and update="@(':input:not(:disabled)')" are cool of course. But the problem could be a lot of partial CDATA sections in response and jQuery's update could be slow theoretically. At least from my point of view. If you select e.g. 100 elements to update, jQuery replaces 100 times DOM. I wanted to say, this way brings flexibility, but it should be used carefully. I don't see any usage at the monent, but we can add it I think.
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:

13 Mar 2012, 10:55

Yes it has pros and cons, as it is an optional feature, it could have its uses cases, thanks!

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

13 Mar 2012, 11:13

Hi Cagatay,

partialSumbit is a great feature! But why not set it true as default?

Why do you need a feature to update multiple components? Do you have an use case for this?

Thanks,
Thomas
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

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

13 Mar 2012, 11:21

partialSubmit is a great feature! But why not set it true as default?
Not sure, maybe backward compatibility. There could be a context param to turn it on by default.

I really don't have a use case for @(jquerySelector), just thought it would be cool.

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests