Another strange problem

10 views
Skip to first unread message

Russ Abbott

unread,
Aug 27, 2011, 8:46:51 PM8/27/11
to google-we...@googlegroups.com
The AppController in the second MVP example looks like this.

public AppController(ContactsServiceAsync rpcService, HandlerManager eventBus) {
    this.eventBus = eventBus;
    this.rpcService = rpcService;
    bind();
}
  
private void bind() {
    History.addValueChangeHandler(this);

    eventBus.addHandler(AddContactEvent.TYPE,
        new AddContactEventHandler() {
          public void onAddContact(AddContactEvent event) {
            doAddNewContact();
          }
        });  
   ...  // The rest of bind( ) is here.

}

I didn't understand why bind( ) was a separate function rather than part of the AppController constructor -- other than coding style issues. So I commented out these lines:

//      bind();
//  }
  
//  private void   bind() {


In other words, I in-lined bind(). When I tried to run it, I got a 404 page not found error. But when I put the lines back it, it ran fine. Why should that be?

-- Russ

P.S. It doesn't really run fine. The original version of Contacts used a FlexTable. That was ok. This version uses HTML instead. It doesn't come out very well.

Reply all
Reply to author
Forward
0 new messages