In fact I expected RequestFactory to behave somehow like GWT-RPC

My view ( probably wrong )

Your RequestFactory expose Interfaces to entities ( in my cas a single entity 
Person )

The Entity Person is a description of some data ( fields of SQL table for short 
)
    The Person class is also used for the server side methods ( findAllPersons 
etc.. ) my getStr()

The PersonProxy interface is a representaion of Person for the client side
The PersonRequest interface is used to acces Entities 

then if I have 

public class Person {
    public static getStr() { return "whatever" }
}

and 

@service(Person.class)
public interface PersonRequest extends RequestContext {
    Request<String> getStr();
}

I expect

factory.personRequest().getStr().fire(new Receiver<String>() { ....

to return my string

But I must be wrong !

Thanks to reply such naives questions

Patrick








  ----- Original Message ----- 
  From: Thomas Broyer 
  To: google-web-toolkit@googlegroups.com 
  Sent: Wednesday, January 12, 2011 10:35 PM
  Subject: Re: RequestFactory No fire




  On Wednesday, January 12, 2011 5:13:35 PM UTC+1, coelho wrote:
    I've built a simple sketch to test Request Factory

    ( as I didn't find any tutorial or example simple enough grab the all thing 
)

    I've just implemented a getStr() method that retuens a String in an entity 
Person

    When I "fire" the method I don't get any reply nor error 

    Here's the code
    ( no error in eclipse , compiled with manen )

    I get the Fire alert when the button is clicked , nothing else ?

    Patrick


    AppRF  factory = null;
      
      public void onModuleLoad() {
      
      factory = GWT.create(AppRF .class);
      
      if (factory == null) {
      Window.alert("No factory");
      }
      
      factory.initialize(new SimpleEventBus());
      
      PersonProxy person = factory.personRequest().create(PersonProxy.class);



  A RequestContext (as returned by your personRequest() method) is a kind of 
"builder" for a request. Here, you're creating one such context, creating a 
PersonProxy within it, and throwing the RequestContext away, which makes the 
PersonProxy unusable (you can mutate it, but nothing else, including adding it 
to another proxy or sending it to the server, because it is attached to a 
context that you no longer have a reference to).

     
      //factory.personRequest().persist().using(person).fire();
      
        final Button sendButton = new Button( "Send" );
        final Button fireButton = new Button( "Fire" );
        
        RootPanel.get("sendButtonContainer").add(sendButton);
        RootPanel.get("sendButtonContainer").add(fireButton);
        

        fireButton.addClickHandler (new ClickHandler() {
    public void onClick( ClickEvent sender) {
    //lh.setText("Handle = " + sqlBox.getHandle());

    Window.alert("Fire");

    factory.personRequest().getStr().fire(new Receiver<String>() {



  I don't know what you expect from this code, but this is just asking for a 
String to the server, without any reference to a PersonProxy (or similar 
server-side entity).


  I don't realy like plugging my own writings in (I highly prefer when others 
do it for me ;-) ), but maybe my recent post on RequestFactory will help you 
understand the big picture(and you'll later re-read the GWT "official doc" with 
a fresh eye): http://tbroyer.posterous.com/gwt-211-requestfactory




  -- 
  You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
  To post to this group, send email to google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


------------------------------------------------------------------------------

------------------------------------------------------------------------------

  Aucun virus trouvé dans ce message.
  Analyse effectuée par AVG - www.avg.fr
  Version: 10.0.1191 / Base de données virale: 1435/3374 - Date: 11/01/2011

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to