how to create graphs in jsf? - jsf

Can anyone give details about creating graphs like bars and lines in jsf ? which one is best ? I want graphs by taking data from database dynamically and should work offline.I want each and every
step of installation and execution.please reply.

Have a look for component libraries which offers graph (chart) components.
For example PrimeFaces (demo) and OpenFaces (demo).

Related

Netbeans JSF Palette

Ok, I have been trying to find answer for two days now. I created new Web Application and added JSF framework to it. But when I opened a palette I can see only few tags to be dragged and dropped. I can see HTML, HTML Forms and JSF categories with only about five tags in each. Do I have to add some library or something? Thank you for help.
You better get rid of Netbeans JSF palette when adding components to your page. Writing directly on the page you will be more productive because you have code completion assistance. If you look at the JSF palette it is like a set of squeleton generators more than an exhaustive components set. So basically I would use, perhaps, only the JSF Data Table [From Entity] palette item.

Is their a way to output to a panel in JSF

I am relatively new to JSF. I am trying to display data into a web page sorta like a jTextArea or at least onto a panel that is on the webpage, something similar to that. I can display the data in a particular format but it won't appear onto a panel in a specific location or the panel being a particular setSize. Can someone point me into the right direction of what I need to learn in order to do this. The simpler the better as I believe in simplicity.
Primefaces provides you many forms to display data: dataGrid, carousel,... you should use pimefaces showcase http://www.primefaces.org/showcase/ui/datagrid.jsf .

How to display "Loading.." while switching tabs

I'm interested is it possible to create tabs with Primefaces using this example?
The idea is to create dynamically loaded tabs and when I switch between pages to display "Loading" at the top right of the page. What are the usual ways is this case?
The example you reference in your question carries the answer to the question. Generally, you have two options
Primefaces ajaxStatus component is designed specifically for your use case and is also the same component used in the dynamic tab sample you linked (albeit the PF team neglected to reference/declare it in the sample markup for that example). It's the same component that is used to generate the "loading" pinwheel you see in that example
A more powerful/exotic option is the blockUi component that will achieve the same effect, albeit with a little more in terms of options and visual effect.

jsf popupwindow with a datatable

I have a form which one of it's fields is a code and description, also a button for opening a popup window that contains a list of all of the available codes.
when the user double clickes a row from that table i want to set these values to the code and description. - how can this be done?
Another question, I want to create this popup and table to be initialized dynamically - by that i mean that if i have a few forms in my application, when ever i have a field which has a description i want to be able to open this popup and to see the available list for that field. (every field can be from a diffrent table). is it possible to create something like that? if so, how?
Any help will be appritiated,
Thank's In Advance.
Yes, it is possible. Even more, many component libraries have ready to use popup/dialog components, such as RichFaces with <rich:popupPanel> and PrimeFaces with <p:dialog>.
If you do not want to use a component library for some reason, you would need to create a custom component for this which generates basically an absolutely positioned HTML <div> element with a CSS overlay which get shown/hidden by JS on a particular click/action. The HTML/CSS/JS part should be relatively simple if you are familiar with those languages. The JSF part is somewhat hard if you have never created a custom component before, but it should be possible with a composite component as well, so you could also just create one with pure XHTML. The updating/refreshing can just take place by the usual <f:ajax> means.

JSF component for Gantt chart

I need a JSF component for representing Gantt chart. Does any component library (like RichFaces) contain such a component?
JFreeChart has a Gantt chart and PrimeFaces has an image component which allows you to dynamically stream content in. Here is an example in combination with JFreeChart.
Alternatively you can also just grab h:graphicImage and let it point to a simple servlet which streams the JFreeChart result to the response based on the request parameters or pathinfo.
JFreeChart does it.
See here for example.
Recent versions of PrimeFaces include a timeline component.
Events in the custom example have end dates, which makes the events to be rendered as bars.
Though it is not full blown Gantt, it could be enough for certain projects.

Resources