1. #1
    Sencha User
    Join Date
    Nov 2009
    Posts
    51
    Vote Rating
    0
    smiletolead is on a distinguished road

      0  

    Default Creating eclipse project for EXT GWT 3.0 Samples

    Creating eclipse project for EXT GWT 3.0 Samples


    Hi all

    I am trying to build eclipse project out of GXT 3.0 samples. It will help me in learning GXT 3.0 faster as I can play with the samples. (I had succeeded in creating eclipse project out of 2.2.5 version without much difficulty).
    Here are the problems I am facing with GXT 3.0.

    1. It looks like entire GXT 3.0 samples do not run GWT hosted mode, that is, in Jetty.
    2. I went on to use external server - Tomcat for the server code. This required compiling samples into Javascript. When I hit GWT compile button, I found got this error

    Rebinding com.sencha.gxt.explorer.client.thumbs.ExampleThumbs
    Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
    Preparing method accordionlayout
    Finding resources
    [ERROR] No com.google.gwt.resources.client.ClientBundle$Source annotation and no resources found with default extensions


    Looks like the sample source is not complete. It is missing resources.


    Where can I get the complete samples source?
    Has anyone successfully build Eclipse project out of the samples?


    --
    Thanks,Ganesh



  2. #2
    Sencha User
    Join Date
    Jan 2009
    Posts
    46
    Vote Rating
    0
    Konstantin.Scheglov is on a distinguished road

      0  

    Default


    Quote Originally Posted by smiletolead View Post
    Looks like the sample source is not complete. It is missing resources.


    Where can I get the complete samples source?
    Has anyone successfully build Eclipse project out of the samples?
    Yes, you can not compile explorer sample.

    Look for example on AccordionUiBinderExample.ui.xml, it attempts to set "appearance" for ContentPanel, but ContentPanel has no method "setAppearance" or constructor marked with @UiConstructor.

    Unfortunately, it seems that samples and library are not in sync - probably there were some problems in library, so for better experience of beta2 some changes were rolled back, but samples - not.

    I've not tried to compile full "explorer" sample, but it is still very useful as simple example for every component.
    As I can see everything except of "Accordion" works.
    Konstantin Scheglov

  3. #3
    Sencha User
    Join Date
    Nov 2009
    Posts
    51
    Vote Rating
    0
    smiletolead is on a distinguished road

      0  

    Default


    It is not the issue with AccordionLayout, but with com.sencha.gxt.explorer.client.thumbs.ExampleThumbs. It is defining image resources, but I don't find any image files in the package com.sencha.gxt.explorer.client.thumbs. So GWT is unable to compile this class.

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Konstantin.Scheglov: Can you point to a case where explorer is not consistent with the same build of GXT? The files are compiled together, with explorer being based on the same version of GXT.jar, so they should be perfectly in sync. If you are comparing the build on staging (built and deployed nightly) with the code in the last beta (some 4 weeks old), there will be inconsistencies - to get a gxt version that matches nightly, you'll need to build from SVN, and to see examples that match the last release, check out http://sencha.com/examples-dev/

    smiletoload: Thanks for the heads up, the examples-src is indeed missing all of the images. Try this: Rename the gxt-examples war to a zip, and open that up. In the WEB-INF/classes/ directory, the same sources should be present, this time complete with images.

    While still in beta, we've been mostly focusing on the library itself, and not spending enough time on good examples and documentation. I'll try to make it easier to create a project from the source found in the downloads.

    Thanks for your feedback.

  5. #5
    Sencha User
    Join Date
    Jan 2009
    Posts
    46
    Vote Rating
    0
    Konstantin.Scheglov is on a distinguished road

      0  

    Default


    File gxt-3.0.0-beta2\examples-src\com\sencha\gxt\explorer\client\layout\AccordionUiBinderExample.ui.xml
    Code:
      <g:VerticalPanel spacing="10">    <gxt:ContentPanel ui:field="panel" appearance="{contentPanelAppearance}" headingText="AccordionLayout"
          bodyBorder="false" pixelSize="200, 325">
          <container:AccordionLayoutContainer ui:field="con" fill="true">
    Note appearance="{contentPanelAppearance}" but ContentPanel has no constructor with @UiConstructor and appearance parameter. There are no setAppearance() method too.
    Konstantin Scheglov

  6. #6
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    True, but that is still valid code, when used with the Java file associated with it, because of this:

    Code:
      @UiFactory
      public ContentPanel createContentPanel(ContentPanelAppearance appearance) {
        return new ContentPanel(appearance);
      }
    The appearance is needed in the constructor, or the entire widget will have to be redrawn after the appearance is set. If we set that to be the uibinder constructor with @UiConstructor, then it would be mandatory to set an appearance. The remaining option is to create panels through a @UiFactory method in the associated Java.

    This should all compile correctly - if it doesn't can you pass along the details of how you are using it, including GWT version?

  7. #7
    Sencha User
    Join Date
    Jan 2009
    Posts
    46
    Vote Rating
    0
    Konstantin.Scheglov is on a distinguished road

      0  

    Default


    My apologies, Colin.
    You are right, this works fine with @UiFactory.
    I've missed it :-(

    However with @UiFactory in this form you now still have to set appearance for each ContentPanel, right?
    Hm... but we could probably just pass "null" and make it work, but attribute "appearance" in now required in any case.
    Well... probably acceptable to avoid redraw.
    Konstantin Scheglov

  8. #8
    Sencha User
    Join Date
    Nov 2009
    Posts
    51
    Vote Rating
    0
    smiletolead is on a distinguished road

      0  

    Default


    I used the source available in WEB-INF/classes folder. Now I am able to compile the project. Thanks Colin! Thanks everyone for responding.

  9. #9
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    There are lots of options when replacing an appearance. If making the change across your entire app, you should be using a replace-with in your module file. If making the change for every instance in a single uibinder class, a zero-arg @UiFactory method can work (or one that takes an appearance arg like this example). If making a change for each instance within a uibinder class, consider creating the instances ahead of time in code, by specifying @UiField(provided = true) and creating the instance in the field.

    One more option for occasional reuse - make a subclass of the widget, with a no-arg constructor, calling the super constructor with a specific appearance. This is what is done in FramedPanel for a framed ContentPanel.

  10. #10
    Sencha User
    Join Date
    Jan 2009
    Posts
    46
    Vote Rating
    0
    Konstantin.Scheglov is on a distinguished road

      0  

    Default


    Thank you for such perfect explanation.
    Konstantin Scheglov