Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGwt eventhandlers and Widget Equivalent class

    I am trying to implement MVP pattern using MVP4g framework. The core GWT's "Composite" class allows my view classes to be initialized as Widget objects (by extending Composite and calling initWidget(myMainPanel)). It also has "HasClickHandlers" and "HasValue<String>" which I can return from my UI widgets (like textbox and passwordtextbox). My issue is that I cannot leverage the framework's support using just the smartGwt UI widgets. How do I manage onClick events and returning my view instance as widgets ?

    #2
    In Other words, I need to know the following when I am implementing a MVP pattern.

    1) I can define my view class as "public class LoginView extends Composite". How can I do the same using SmartGWT. If I extend the Composite class, all I need to do is all the initWidget(theMainPanel). If I need to get the entire widget to be displayed somewhere, I just create a getter
    Code:
    	public Widget getViewWidget() {
    		return this;
    	}
    in my view and call it from my presenter.

    2) In my view class, I can simply define

    Code:
    	public HasClickHandlers getButton() {
    		return (HasClickHandlers) login;
    	}
    
    	public HasValue<String> getPassword() {
    		return password;
    	}
    and use these methods in my presenter as follows:

    Code:
           view.getButton().addClickHandler(new ClickHandler(){
           public void onClick(ClickEvent event) {
           //do something
          }
          )};
    and

    Code:
        view.getPassword().getValue();
    How do I use SmartGWT to achieve the same functionality ?
    Last edited by dmanchikalapudi; 23 Feb 2010, 19:11.

    Comment


      #3
      Hi,

      Was this ever resolved? Did you perhaps find another solution? I am too encountering the same problem trying to implement MVP patterns with SmartGWT.

      Thanks in advance

      Xandel

      Comment

      Working...
      X