Calling Seam component from JavaFX

We very close to moving Flamingo and Fiji to exadel.org. It will probably (finally) happen next week. I just wanted to show how simple it is to call a Seam component from JavaFX using Flamingo:

Seam component (server):

@Name ("currentTime")
public class CurrentTime {
   public Date currentTime () {
	return (new java.util.Date());
   }
}

Service interface (client):

public interface CurrentTime {
   public Date currentTime ();
}

JavaFX script (client):

FXServiceFactory.URL = "http://localhost:8080/server-javafx/seam/resource/hessian/";
var ct = (FXServiceFactory.getService(CurrentTime.class,"currentTime") as CurrentTime);
var now = ct.currentTime();
FX.println(now);

That’s it!

Published by

9 responses to “Calling Seam component from JavaFX”

  1. […] showed how to call a Seam component with Flamingo from JavaFX. In this post I show how to invoke Hibernate […]

  2. […] addition to calling methods and Hibernate Validator, it’s also very simple to bind to a context variable and update it […]

  3. […] to communicate with a server using Exadel Flamingo. See my previous posts on Enterprise JavaFX: calling Seam component from JavaFX, invoking Hibernate Validator from JavaFX, and binding to server-side context variable from […]

  4. […] Calling Seam component from JavaFX Invoking Hibernate Validator from JavaFX Binding to server-side context variable from JavaFX Using Expression Language (EL) in JavaFX to communicate with server […]

  5. hi,

    I am getting

    cannot access com.sun.javafx.runtime.location.ObjectVariable
    class file for com.sun.javafx.runtime.location.ObjectVariable not found

    for the FXServiceFactory.URL

    I am using JavaFX 1.3 and latest flamingo 2.2.0

    Thaniks.

  6. The error means you are probably still using JavaFX 1.2.x. Make sure you are using version 1.3. Please post any follow up questions to Flamingo forum.

  7. hi max, already posted in forum, however still facing issues although i should be using JavaFX 1.3 from Netbeans 6.9. See http://exadel.org/node/108.

    Thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.