Archive for the 'Flex' Category

Quick start with Fiji – RichFaces project for Flex template

I created a Fiji template project which you import into Eclipse, deploy and run. The applications demonstrates a number of Fiji charts and as well fiji:swf component which lets you import any Flash component into your JSF page.

What you need to do:
1. Download Fiji template: http://drop.io/kr9xii8.
2. In Eclipse, select File/Import/General/Existing Project Into Workspace
3. Click Next
4. Check Select archive file radio button and browse to the downloaded file.
5. Download Fiji from http://www.exadel.com/web/portal/download/fiji and add fiji-api-1.x.x..jar and fiji-ui-1.x.x to WEB-INF/lib directory in the template.
6. One last step is to deploy, I’m sure you know how to do it

A few notes:
- I’m using RichFaces 3.3.1 RC1, you can download a newer version if available.
- I tested the application with Tomcat 6

Fiji: RichFaces project for Flex

Check out Richfaces for Flex project, know as Exadel Fiji. Fiji allows to use JSF and Flex components together on the same page while binding Flex components to standard JSF managed beans. Fiji also provides 7 out-of-the-box Flash-based charting components.

Suppose you need to embed a Flex chart in your JSF page, to deliver richer content. This is all you need to do:

JSF page:

<h:form>
 <fiji:lineChart value="#{barChartBean.data}" title="Bar chart"
		   width="450" height="250">
   <fiji:chartData type="name" value="Just some numbers" />
 </fiji:lineChart>
</h:form>

Managed bean:

public class BarChartBean {
  public BarChartBean() {
  }
  private Integer[] data;
  public Integer[] getData() {
	return data;
  }
  @PostConstruct
  public void init () {
	data = new Integer[5];
	data[0] = 5;
	data[1] = 2;
	data[2] = -3;
	data[3] = 10;
	data[4] = 9;
 }
}

You will get this:
screenshot01.png

The most important thing is that you bind these components to standard JSF managed beans (or Seam components).


More Fiji resources

Fiji product page
Fiji demo
Fiji charting components (JSF, Flex and Elections)
Fiji article at dzone.com

Fiji is free until December 31 – JSF and Flex together

Fiji is free until December 31.

Fiji allows to use JSF and Flex components together on the same page while binding Flex components to standard JSF managed beans. Fiji also provides 7 out-of-the-box Flash-based charting components.

Fiji resources:

Fiji product page
Fiji demo
Fiji charting components (JSF, Flex and Elections)
Fiji article at dzone.com

Fiji example from richability

Nice Fiji post and example created by richability from Switzerland.

JSF, Flex, and Elections 2008

On the heels of elections this week, let me show you how you can use JSF and Flex to build nice looking Flash-based charts with elections results. To use JSF and Flex together, I will be using Exadel Fiji.

Let’s start with electoral votes and use a column chart. Below is an example using rich:columnChart component. It’s a static image here, but it’s actually a Flash component in a JSF page. As you move the mouse over columns, a tool tip is shown.

screenshot01.png

1
2
3
4
5
6
7
8
<rich:panel header="Elections 2008">
   <fiji:columnChart value="#{columnChart.data1}" width="350"
	 height="450" title="Electoral votes" captionX="Candidates"
	 captionY="Electoral Votes" barColors="#{columnChart.barColor}"
         toolTipValue="{x} has {y} {name}" rulersValuesHighlight="none">
	<fiji:chartData value="electoral votes" type="name" />
  </fiji:columnChart>
</rich:panel>

fiji:columnChart is a JSF component and renders a Flash chart. What’s really neat is that you can use standard JSF managed beans to provide data for the chart. Here is the managed bean (you can also use Seam components):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public class ColumnChart {
 
   private HashMap<String, Integer> data1;
   private ArrayList<String> barColor;
 
   public ColumnChart() {}
 
   @PostConstruct
   public void init() {
      data1 = new HashMap<String, Integer>();
      data1.put("Obama", 349);
      data1.put("McCain", 163);
 
      barColor = new ArrayList<String>();
      barColor.add("#003366");
   }
}

Easy, right?

Let’s move to bar chart using fiji:barChart component. This charts shows percentage of vote each candidate received.

screenshot02.png

1
2
3
4
5
6
<fiji:barChart value="#{barChart.data2}" width="450" height="250"
   title="% Vote" captionX="Candidates" captionY="Vote %"
   barColors="#{barChart.barColor}" toolTipValue="{x} has {y} {name}"
   rulersValuesHighlight="none">
	<fiji:chartData value="% vote" type="name" />
</fiji:barChart>

Managed bean for the chart:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public class ColumnChart {
 
   private HashMap<String, Integer> data2;
   private ArrayList<String> barColor;
 
   public ColumnChart() {}
 
   @PostConstruct
   public void init() {
      data2 = new HashMap<String, Integer>();
      data2.put("Obama", 53);
       data2.put("McCain", 46);
 
      barColor = new ArrayList<String>();
      barColor.add("#003366");
   }
}

There are other charts in Fiji such as stackedBarChart, stackedColumnChart and lineChart. You can see them all in action here.

These charts come out of the box with Fiji. What if you want to use a Flash component that you built or someone else did? You can use fiji:swf component to wrap any existing Flash module. I’m going to use a pie chart component made by amCharts.com . I will use the pie chart to show popular vote numbers.

screenshot04.png

1
2
3
4
5
6
7
8
9
<fiji:swf src="/elections/ampie.swf" bgcolor="#FFFFFF" 
   width="520" height="400">
   <f:param name="path" value="/elections" />
   <f:param name="settings_file"
    value="#{facesContext.externalContext.requestContextPath}/elections/ampie_settings.xml" />
   <f:param name="data_file"
    value="#{facesContext.externalContext.requestContextPath}/elections/ampie_data.xml" />
   <f:param name="preloader_color" value="#999999" />
</fiji:swf>

Using fiji:swf it’s possible to wrap any Flash component as JSF component. f:param is then used to provide data for the JSF component and in turn for the Flash module.

If you want to try Fiji, check out this article on dzone.com

Webinar: Using JSF and Flex Components Together

Learn how to use JSF and Flex components together using Fiji. This webinar will demonstrate a simple way to use JSF and Flex components on the same page and application while binding them to the same data model, similar to JSF managed beans. More.

Date: Thursday, October 23, 2008
Time: 2 p.m. (EDT)

Click to register.

Speaking at The Ajax Experience 2008, Boston

image003.gif

At the end of September I’m speaking at The Ajax Experience 2008 in Boston. My talk is on technologies available today for building enterprise Rich Internet Applications.

Link: Enterprise Rich Internet Application Tools: JSF, Flex, and JavaFX

New JSFOne session: Using JSF and Flex Components Together

jsfone_spkr_125x125.jpg

Besides my previously scheduled sessions JBoss RichFaes and Rich Internet Applications Tools: JSF/RichFaces, Flex, and JavaFX I’m doing a new session on Using JSF and Flex Components Together.

Here is the session abstract:

This session will demonstrate a simple way to use JSF and Flex components on
the same page and application while binding them to the same data model
(like JSF managed beans).

JSF and various rich component libraries enable the building of sleek
and sophisticated AJAX-based RIA applications. To kick it up a notch,
Flex components can be used to create a user experience beyond what the
browser allows. Flex applications run inside a Flash player virtual
machine plug-in and provide far richer experiences than the browser
alone. However, using JSF components and Flex components on the same
page is a challenge today without some “plumbing” layer underneath.

Speaking at The Ajax Experience 2008, Boston

In addition to presenting JSFOne in early September, I’m also speaking at The Ajax Experience, in Boston on Wednesday, October 1st. My session title is: Enterprise Rich Internet Application Tools: JSF, Flex, and JavaFX (read more on conference web site).

I like Boston very much, and early October is definitely one of the best times to be in Boston because fall foliage.

I’m speaking at JSF*One conference

jsfone_spkr_125x125.jpg

I’m happy to announce I will be speaking at JSF*One conference being held in Vienna, VA, September 4-6th. The conference is being organized by Kito Mann along with No Fluff Just Stuff Symposiums. It’s going to be a great conference, it’s loaded with JSF heavy weights: Ed Burns, David Geary, Kito Mann , Keith Donald, Chris Schalk, Michael Yaun, Ed Burns, Max Katz, Ted Goddard, Jeremy Grelle, Stan Silvert, and others.

If you are planning or already using JSF, and want to learn how to build RIA applications with JSF or other technologies (Flex/JavaFX) this will be a great conference to attend.

I’m doing two talks:

Thursday, September 4 at 5PM
JBoss RichFaces

Friday, September 5 at 3:30PM
Rich Internet Applications Tools: JSF/RichFaces, Flex, and JavaFX

The other added bonus is that JSF*One will be running along The Rich Web Experience East. Your pass to JSF*One will also let you into The Rich Web Experience – you can completely immerse yourself into Ajax/RIA world for a few days.

I’ll be glad to chat with anyone about their RIA plans.

Next Page »