[JBoss Seam] - Re: Charts
by hispeedsurfer
Here is an example based on engelme idea that is working for me
import java.io.IOException;
| import java.io.Serializable;
|
| import org.jboss.seam.annotations.Name;
| import org.jfree.chart.ChartFactory;
| import org.jfree.chart.ChartUtilities;
| import org.jfree.chart.JFreeChart;
| import org.jfree.chart.plot.PiePlot;
| import org.jfree.data.general.DefaultPieDataset;
|
|
| @Name("chartprocesser")
| public class ChartProcessor implements Serializable{
| /**
| *
| */
| private static final long serialVersionUID = 1L;
| byte[] chart;
|
|
| public void createChart()
| {
|
| final DefaultPieDataset dataset = new DefaultPieDataset();
| dataset.setValue("One", new Double(43.2));
| dataset.setValue("Two", new Double(10.0));
| dataset.setValue("Three", new Double(27.5));
| dataset.setValue("Four", new Double(17.5));
| dataset.setValue("Five", new Double(11.0));
| dataset.setValue("Six", new Double(19.4));
| final JFreeChart chart = ChartFactory.createPieChart(
| "Pie Chart Demo 2", // chart title
| dataset, // dataset
| true, // include legend
| true,
| false
| );
| final PiePlot plot = (PiePlot) chart.getPlot();
| plot.setNoDataMessage("No data available");
|
| try{
| this.chart = ChartUtilities.encodeAsPNG(chart.createBufferedImage(400, 400));
| } catch (IOException e){
| e.printStackTrace();
| }
|
| }
|
|
| public byte[] getChart() {
| createChart();
| return chart;
| }
|
|
| public void setChart(byte[] chart) {
| this.chart = chart;
| }
|
| }
<a:form id="chartform">
| <a:outputPanel id="chart">
| <s:graphicImage value="#{chartprocesser.chart}"/>
| </a:outputPanel>
| </a:form>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103576#4103576
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103576
18 years, 8 months
[JBoss Seam] - s:selectItems and subclasses
by MSchmidke
Hello all,
I'm not quite sure whether this is a seam problem or a general JSF problem, but perhaps you can help me.
I have problems getting the right h:selectOneMenu highlighted caused by Hibernate proxy class hierarchie.
I am using a h:selectOneMenu together with s:selectItems and s:convertEntity.
The objects displayed are from a class hierarchie, say,
abstract class A
class B extends A
class C extends A
, which are EJB3 entities.
The list which is displayed (the selectitems) are some entities of class B or C.
The object which is selected is a lazy loaded reference from some other entity, so that in fact, the displayed object is not an instance of B or C but an instance of Proxy-For-A ("A_$$_javassist_77" or so).
com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption() now tries to determine for every object in the list whether it is selected. To check the selected state, it first tries to coerce the current iterated value to the type of the selected value, i.e. from B to Proxy-For-A, before it does an equals() compare.
Of course, this leads to an exception, which is silently ignored and no object is displayed as selected.
Any ideas??
Marcus.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103574#4103574
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103574
18 years, 8 months
[JBoss Messaging] - FIFO Ordering also if Rollback (Retry)?
by mclu
Hi again!
At our project the order of the messages is important.
For that we configured the listener (MDB) as a SingletonMDB (maxMessages and maxSession is set to "1").
But in cases of a (network or handling) failure the message is marked as retry. New messages which arrived in between are processed BEFORE the other message retries. So the order is scrambled.
Is it possible to configure a real FIFO also in case of retry? I think the order issue is a common requirement.
I only want to stop the queue processing as long as the message can be delivered or I decide via timeToLive or in my code that this message can be dropped.
Is this already possible or is this in the pipeline/feature request?
Greets Markus Lutum / Germany
PS: I do not want to discuss the design of my clients application. Its historical grown. But I want to get rid of all the self implemented Queues with persistent storage and there BUGs :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103569#4103569
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103569
18 years, 8 months