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!

9 comments

  1. Pingback: Invoking Hibernate Validator from JavaFX | Maxa Blog
  2. Pingback: Binding to server-side context variable from JavaFX | Maxa Blog
  3. Pingback: Using Expression Language (EL) in JavaFX to communicate with server | Maxa Blog
  4. Pingback: Seam conversation from JavaFX | Maxa Blog
  5. Pingback: Enterprise JavaFX with Seam and Flamingo – complete edition | Maxa Blog
  6. chuaky

    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.

  7. max

    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.

Leave a Reply