New component pe:statusBar

Community Driven Extensions Project
cfr
Posts: 15
Joined: 11 Jan 2012, 12:27

04 Apr 2012, 13:19

Is it possible to add a new component to the primefaces extensions called p:statusBar which is based on the code of the progressBar in version 3.1 of primefaces? I am using the progressbar in my application to display some limitations like 2/10 uploadable files. So it is used to display a current status. Before the reimplementation of the progressbar, I could update the values by updating the component or the form. Now it seems that I haven't got the possibility anymore to use the progressbar in combination with a value from a backing bean without ajax.

Is it possible to contribute to primefaces extensions? What do I have to do to work with you on new components?

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

04 Apr 2012, 13:55

Hi and welcome,

Yes, it's possible to contribute. But any new component should be more or less unique and should not have "extends SomePrimeFacesComponent" or large copy-paste snippets. All widgets are unique too, without reusing of PF widgets, except BaseWidget. Think about maintenance from release to release. We only use core stuff and not overwrite PF stuff.

Can you describe (shortly) please what p:statusBar should do different in comparison to p:progressBar? A status bar can be normally implemented with standard JSF stuff. Does it do more than value displaying? A use case would be good. Thanks!
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

cfr
Posts: 15
Joined: 11 Jan 2012, 12:27

11 Apr 2012, 09:27

The behaviour of pe:statusBar should be the same as the p:progressBar was before the release 3.2. I could also use p:meterGaugeChart. But the height of this component would break my current design. It should look like a simple progressBar with the behaviour of the old progressBar or the meterGaugeChart:

Image

Which component of the standard JSF stuff could be the base to do it just with JSF?

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

11 Apr 2012, 09:38

whats the difference between 3.2 and 3.3 progressBar?
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

cfr
Posts: 15
Joined: 11 Jan 2012, 12:27

11 Apr 2012, 09:56

In 3.1.1 the progressBar could also be used as a statusBar. But after the reimplementaion of the progressBar in 3.2 it can only be used as a progressBar. If I would like to read a value from a Bean I have to live with an ajax request which is called every three seconds by default and you have to start the progressBar explicit.

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

11 Apr 2012, 10:02

why not create an feature request for this in Primefaces?
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

cfr
Posts: 15
Joined: 11 Jan 2012, 12:27

11 Apr 2012, 10:15

There are some reasons. First of all I need a quick solution. I thought that the fastest way would be to copy the code of the progressBar from version 3.1.1 of primefaces and build a new component in the primefaces extensions. The reimplementation of the progressBar should remove the jQuery based solution. So I think that they do not want the code in the primefaces code anymore. Even if it would now be the p:statusBar. Another reason of mine is, that it could be useful to understand how a new component can be added to the primefaces extensions and how to contribute own components if there are appropriate. There are more users than just me, that were using the progressBar as a statusBar:
viewtopic.php?f=3&t=19165&p=62346#p62346

The ticket underneath got the status "won't fix". I am not sure if a new ticket with a feature request would be handled different to this ticket:
http://code.google.com/p/primefaces/iss ... il?id=3707

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

11 Apr 2012, 11:16

Hi Christoph.

Yes, progress bar has another aim. A progress bar displays progress :-) And progress should be updated permanently. A status bar is static and gets value from bean. I need this component too actually. We have a Struts project with nested DIVs simulating a status bar (as relevance for found hits after a special search). I propose to create an issue ticker in our issue tracker and I will take care about it. But not in the upcoming 0.5 release. In 0.6. Please create an issue ticket http://code.google.com/p/primefaces-ext ... ssues/list

Just two questions yet. Do you need customized images inside status bar like progress bar? Do you need JS method to set value?
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

cfr
Posts: 15
Joined: 11 Jan 2012, 12:27

11 Apr 2012, 11:44

Hi Oleg,
Do you need customized images inside status bar like progress bar?
The image I am using is specified by CSS. I do not need a special attribute to set an image.
Do you need JS method to set value?
An attribute value should be enough in my case. Is this question related to the widgetVar attribute? Sometimes I am using the widgetVar attribute to initialize a javascript instance of the component and to set the value of it but not in this case.
Please create an issue ticket
http://code.google.com/p/primefaces-ext ... ail?id=163

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

11 Apr 2012, 12:22

Ok. I propose then we implement a simple pe:statusBar without widget. As output component. No input. What do you think about pe:outputStatusBar? Prefix is similar to h:outputText, h:outputLabel, h:outputFormat.

Code: Select all

<pe:outputStatusBar value="#{statusBarBean.value}" labelTemplate="{value}%" labelPosition="right" styleClass="animated"/>
I would use it as follows in my DataTable:

Code: Select all

...
<p:column>
    <pe:outputStatusBar value="#{statusBarBean.value}" title="Relevance #{statusBarBean.value} %" styleClass="myStatus"/>
<p:column>
...

<pe:tooltip global="true" forSelector="myStatus"/>
I don't know by the way if we need "labelTemplate" attribute at all. Because it's not flexible. You can only show value and not e.g. 2/10. We can introduce another attribute "label" in addition to "labelTemplate". You can bind then any label from bean: label="#{statusBarBean.label}". What do you think?

We can also call it pe:outputProgressBar. Because the word "status bar" has a little bit another semantic.
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

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests