I need Urgent help in JSF, RichFaces, Jfree chart. I am new for these technolgies.
I am having form which is having some drop down menu and one submit button. Suppose I selected 'A' from dropdown this selection pass to Java code based on which DAO layer will return row counts. This count is passed in Jfree Pie chart method to create a Pie chart. In UI I need to display this chart in second Panel of same Dropdown page. UI is developed with RichFaces. Code is as below for UI:
In above code in <a4j:commandButton> I used reRender attribute, which is having same id as given in <a4j:outputPanel id="resultPanelId" ajaxRendered="true">. If I am first time loading page then I can see Pie chart is coming on UI this is due to <a4j: mediaOutput createContent attribute where I am calling the function which is calling Chart creation function. But if I am selection one item from Drop down and then submitting the Form chart is not getting displayed. Though in console I can see Graph method is called, but then some Decode error is coming :
ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error decode resource data
Please help me to know how I can display Pie chart after submitting form. As of now I only know that richfaces mediaOutput I can use. Please help on urgent basis.
that is having "session" scope. Actually we want to implement the code in following way using JSF, Ricfaces:
1. User will see dropdown list in UI. He will select one iten from Dropdown and submit the selection.
2. This selection will be saved in dashboardCtrl bean, which is further used by DAO layer to get the count of records.
3. These count of records need to pass in CHart method which in turn return the graph.
In below code during time of Hit to VIew chart button selected data is getting stored in dashBoardCtrl bean and then in mediaOutput calling the Chart creator method.
This is required to refresh the chart based on User selected values, that is te reason used Re-render. Now don't know this is the correct way or not
As far as generating 2 different sub-Views from a single Model object, that's one of the advantages of using an MVC design (such as JSF). The decoupling of the Views and Models via the Controllers means that you don't have (sub)View-specific code or properties in the model.
Sometimes the only way things ever got fixed is because people became uncomfortable.