backing-beans

Generate png/jpeg image of Primefaces Charts in backing bean?

眉间皱痕 提交于 2019-12-06 10:23:34
问题 I am using Primefaces 3.1.1 charts in my application, there is no problem generating charts in JSF page, but I'm trying to find out if it's possible to generate image (png or jpeg) for the charts so that I can insert these images into an Excel file (Apache POI) in java. I know the latest Primefaces version 3.4.1 has an Export Chart feature, but the generated image only occurs at the client side (it's jqPlot). But I need it on the server side. Currently we are using jFreeChart in the backing

How to (or should you) avoid long methods/classes in jsf

限于喜欢 提交于 2019-12-06 04:01:13
问题 I'm mostly working with legacy code in a JSF based project and there are lots of quite long classes and methods in backing beans. This is constantly bugging me but when I look for what can be done, most of the time all I can come up is to divide a long method to n small methods. Which gives you still a very long class and sometimes harder to read too. So what do you do to keep your backing beans short and concise? Or do you keep one big backing bean for one page? Are there any best-practices?

Generate png/jpeg image of Primefaces Charts in backing bean?

走远了吗. 提交于 2019-12-04 17:52:49
I am using Primefaces 3.1.1 charts in my application, there is no problem generating charts in JSF page, but I'm trying to find out if it's possible to generate image (png or jpeg) for the charts so that I can insert these images into an Excel file (Apache POI) in java. I know the latest Primefaces version 3.4.1 has an Export Chart feature, but the generated image only occurs at the client side (it's jqPlot). But I need it on the server side. Currently we are using jFreeChart in the backing bean for this purpose, so the charts in browser looked very different from the charts in Excel. We are

How to (or should you) avoid long methods/classes in jsf

跟風遠走 提交于 2019-12-04 07:08:55
I'm mostly working with legacy code in a JSF based project and there are lots of quite long classes and methods in backing beans. This is constantly bugging me but when I look for what can be done, most of the time all I can come up is to divide a long method to n small methods. Which gives you still a very long class and sometimes harder to read too. So what do you do to keep your backing beans short and concise? Or do you keep one big backing bean for one page? Are there any best-practices? I assume this is not directly related to jsf but to any model where you are 'backing' up your view

ViewScope constructor called twice, not sure why

六眼飞鱼酱① 提交于 2019-12-03 13:55:51
问题 I've seen the other questions regarding calling a bean constructor and ViewScope, and I'm still having difficulty. The problem I'm seeing involves two specific pages in my application. The first is a dataTable (for now it is filled with randomly generated data but will eventually call a database), the second page is a fairly simple display page in which information from the selected row is displayed in a form for either editing or viewing - this is my detail.xhtml page. It is the bean for

View scope: java.io.NotSerializableException: javax.faces.component.html.HtmlInputText

試著忘記壹切 提交于 2019-12-02 06:09:50
问题 There is an error each time a button calls an action from the backing-bean. Only applies to beans with a view scope and I haven't found a way to fix it without regression over other modules in the code. DefaultFacele E Exiting serializeView - Could not serialize state: javax.faces.component.html.HtmlInputText java.io.NotSerializableException: javax.faces.component.html.HtmlInputText at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) Or also: com.ibm.ws.webcontainer

View scope: java.io.NotSerializableException: javax.faces.component.html.HtmlInputText

心已入冬 提交于 2019-12-02 01:51:55
There is an error each time a button calls an action from the backing-bean. Only applies to beans with a view scope and I haven't found a way to fix it without regression over other modules in the code. DefaultFacele E Exiting serializeView - Could not serialize state: javax.faces.component.html.HtmlInputText java.io.NotSerializableException: javax.faces.component.html.HtmlInputText at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) Or also: com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause Faces Servlet:

How do I attach a FacesMessage from the backing bean to a specific field in a ui:repeat?

家住魔仙堡 提交于 2019-12-01 20:56:13
I have a form with a variable number of input elements, like this: <ui:repeat var="_lang" value="#{myBean.languages}"> <h:inputTextarea value="${_lang.title}" id="theTitle" /> <h:messages for="theTitle"/> </ui:repeat> When a certain method in the backing bean is triggered, I want to add a message to, say, the second iteration of the ui:repeat , but not the other ones. I've seen different variations of this question around here , and all problems appear to be due to the ui:repeat 's iterations not being available in the JSF component tree. What I have tried so far: Bind the h:inputTextarea s to

web.xml setup for facelets template and client

喜夏-厌秋 提交于 2019-11-29 17:36:17
I've looked at a few resources for JSF and facelets, but don't understand a few configuration points. What's the distinction between: <url-pattern>/faces/*</url-pattern> and: <url-pattern>*.jsf</url-pattern> While I understand it's possible to have several url-pattern elements, unless .jsf pages are explicitly being used, there's no actual need for this mapping, correct? If only faces templates and clients are being used, then it's extraneous? Furthermore, if the facelet template and client are inside WEB-INF , how are they accessed? With the latest releases for JSF and Facelets, there seems

web.xml setup for facelets template and client

假如想象 提交于 2019-11-28 12:50:01
问题 I've looked at a few resources for JSF and facelets, but don't understand a few configuration points. What's the distinction between: <url-pattern>/faces/*</url-pattern> and: <url-pattern>*.jsf</url-pattern> While I understand it's possible to have several url-pattern elements, unless .jsf pages are explicitly being used, there's no actual need for this mapping, correct? If only faces templates and clients are being used, then it's extraneous? Furthermore, if the facelet template and client