Announcement

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

    GWT 2.0 UIBinder Compatible ?

    Hello,

    I am currently considering to rewrite a project using pure GWT 2.0 to use SmartGwt as it offers a better set of widgets.

    I need to know if SmartGwt works with the UiBinder mechanism?

    thank you for your help,

    Mike

    #2
    I made some spike-testing on UI Binder just a month ago.
    It seemed to work good, but I only tried to declaratively add an IButton in the XML definitions. That worked, but who knows if SmartGWT is certificated?
    Give it a try, and let us know! :)

    Comment


      #3
      not really working ?

      Well, after having played with it for a bit, the following simple test seems to fail:

      WSim.java:

      public class WSim implements EntryPoint {

      @UiTemplate("WSim.ui.xml")
      interface WSimUiBinder extends UiBinder<Widget, WSim> {
      }

      private static WSimUiBinder uiBinder = GWT.create(WSimUiBinder.class);

      // inject Css style
      {
      WsimResources.INSTANCE.GlobalCss().ensureInjected();
      }

      // constructor
      public WSim() {
      uiBinder.createAndBindUi(this);
      }

      @UiField
      VLayout vPanelMain;
      @UiField
      IButton button;

      public void onModuleLoad() {
      contructWidget();
      // Place widgets in the html page
      RootPanel.get("wsimulator").add(vPanelMain);
      }

      private void contructWidget() {
      vPanelMain.addMember(button);
      }
      }

      ...with the following WSim.ui.xml:

      <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
      <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
      xmlns:smartLay="urn:import:com.smartgwt.client.widgets.layout"
      xmlns:smart="urn:import:com.smartgwt.client.widgets"
      xmlns:dp='urn:import:com.dp.frontend.wsim.gwt.client.panels'
      xmlns:wsim='urn:import:com.dp.frontend.wsim.gwt.client.sim'>

      <smartLay:VLayout width="418px" ui:field="vPanelMain">

      <smart:IButton ui:field="button"/>

      </smartLay:VLayout>

      </ui:UiBinder>

      Error Message:

      found unexpected child "<smart:IButton ui:field='button'>"

      Now it does that regardless of what the "child" is, also tried a Label... replacing the VLayout with a simple Canvas also produces the same error.

      Ideas ?

      Comment


        #4
        Have not looked at what the problem might be, but consider this quote from UIBinder's overview documentation:

        At heart, a GWT application is a web page. And when you're laying out a web page, writing HTML and CSS is the most natural way to get the job done.
        SmartGWT is aimed primarily at sophisticated enterprise applications, where it's completely inappropriate to attempt the kind of full-screen, highly dynamic layouts involved by just using HTML and CSS.

        Furthermore, one of the key advantages of SmartGWT is shielding you from browser bugs and DOM idiosyncrasies. The approach suggested by UiBinder means troubleshoot differences in CSS and HTML layout behavior on every browser, every operating system, and every browser version where your application needs to run.

        So we'd suggest first revisiting whether this makes sense at all.

        Comment

        Working...
        X