The Artima Developer Community
Sponsored Link

Articles Forum
Integrating Flex with a Java EE Application, Part II

1 reply on 1 page. Most recent reply: Feb 19, 2010 1:34 AM by Devika N

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Integrating Flex with a Java EE Application, Part II Posted: Apr 23, 2009 10:00 AM
Reply to this message Reply
Advertisement
Part II of this three-part article series demonstrates different ways Flex can interact with server-side data sources, including fetching JSON and XML via HTTP, and invoking server-side Java objects from a Flex client.

http://www.artima.com/articles/enterprise_flex_part_2.html

What do you think of Flex's ability to integrate with enterprise Java applications?


Devika N

Posts: 1
Nickname: devikanrgh
Registered: Feb, 2010

Re: Integrating Flex with a Java EE Application, Part II Posted: Feb 19, 2010 1:34 AM
Reply to this message Reply
Hi,

Here is the code to add Fiji Chart dynamically.

import com.exadel.fiji.component.html.HtmlBarChart;
import com.exadel.fiji.component.html.HtmlChartData;
:
:

HtmlChartData chartData =new HtmlChartData();
chartData.setValue(new MedalsBean().getNames());


HtmlBarChart chart=new HtmlBarChart();
chart.setValue(new MedalsBean().getMedalsData());
chartData.setParent(chart);

chart.setBarColors(new MedalsBean().getColors());
chart.setWidth(200);
chart.setHeight(200);
chart.setId(chart.getClientId(_context)+1);
chart.setRendered(true);
:
:
But this chart is not rendering. i.e there is some error in Filling Data to chart.

Can anybody tell me how to add the Chart dynamically.
Code For MedalBean

package fiji;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;

import javax.annotation.PostConstruct;

public class MedalsBean {
private Map<String, Integer[]> medalsData = new LinkedHashMap<String,Integer[]>();
private ArrayList<String> colors = new ArrayList<String>();
private ArrayList<String> names = new ArrayList<String>();

private Integer[] medalsChina = new Integer[]{51, 21, 28};
private Integer[] medalsUSA = new Integer[]{36, 38, 36};
private Integer[] medalsRussia = new Integer[]{23, 21, 28};

private String countrySelected;
private String medalTypeSelected;
private String medalCountSelected;

public String getCountrySelected() {
return countrySelected;
}

public void setCountrySelected(String countrySelected) {
this.countrySelected = countrySelected;
}

public String getMedalTypeSelected() {
return medalTypeSelected;
}

public void setMedalTypeSelected(String medalTypeSelected) {
this.medalTypeSelected = medalTypeSelected;
}

public String getMedalCountSelected() {
return medalCountSelected;
}

public void setMedalCountSelected(String medalCountSelected) {
this.medalCountSelected = medalCountSelected;
}

@PostConstruct
private void init() {
medalsData.put("China", medalsChina);
medalsData.put("USA", medalsUSA);
medalsData.put("Russia", medalsRussia);

names.add("Gold");
names.add("Silver");
names.add("Bronze");

colors.add("#DAA520");
colors.add("#C0C0C0");
colors.add("#B87333");
}

public Map<String, Integer[]> getMedalsData() {
return medalsData;
}
public ArrayList<String> getColors() {
return colors;
}
public ArrayList<String> getNames() {
return names;
}
public Integer[] getMedalsChina() {
return medalsChina;
}
public Integer[] getMedalsUSA() {
return medalsUSA;
}
public Integer[] getMedalsRussia() {
return medalsRussia;
}
}

Thanks in advance.

Regards
Devika.N

Flat View: This topic has 1 reply on 1 page
Topic: Bend your Pixels with Flex 4 Previous Topic   Next Topic Topic: An Introduction to XML Data Binding in C++

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use