Re: UiHandler and how to do it right?

2011-09-08 Thread Ben Munge
Do you have a corresponding field in your UIBinder ui.xml with the
same ui:field property?

For example, in your ui.xml you should have:

g:Button ui:field=buttonClick Me/g:Button

In the corresponding Java class you should have:

@UiField
Button button;

@UiHandler(button)
void clickButton(ClickEvent e) {
Window.alert(Hello World);
}


As Steve said, the method name on the UiHandler can be anything. The
parameter to the method determines the event being handled. As long as
your ui:field property, the variable name on the UIField, and the
quoted text on the @UiHandler annotation match everything should work
fine.


On Sep 8, 6:55 am, Volker volker.kinderm...@googlemail.com wrote:
 I try to get a button working using UiBinder with UiHandler.
 Unfortunately the screen shows up fine but the button does not react
 on any clicks. While searching for some good examples how to use the
 UiHandler annotation I got confused.

 The tutorial on the official gwt site says:
 @UiHandler(button)
 void handleClick(ClickEvent e) {
     Window.alert(Hello, AJAX);}

 http://code.google.com/intl/de-DE/webtoolkit/doc/latest/DevGuideUiBin...

 The UiHandler Java doc point to some test code telling me:
 @UiHandler({buttonClick, labelClick})
 void doClick(ClickEvent event) {
     eventMessage(event);

 }

 http://code.google.com/p/google-web-toolkit/source/browse/releases/2

 Searching this group I got totaly lost, because it looks like some
 implicit naming convention:
 @UiHandler(lastName)
 void onLastNameBlur(BlurEvent event) {
   // code from UpperCase goes here}

 http://groups.google.com/group/google-web-toolkit/browse_thread/threa...

 Thanks in advance for any clarification.

-- 
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.



Re: is there a Naming conventions of gwt?

2011-09-08 Thread Ben Munge
Could you be more specific? GWT does utilize convention over
configuration in several aspects. This is especially apparent in the
UIBinder model where naming conventions allow you to easily associate
Java elements and methods with the defined elements in your ui.xml.

On Sep 8, 5:26 am, wahaha il...@yahoo.com.cn wrote:
 is there a Naming conventions of gwt?

-- 
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.



Re: Is there a GWT book covering version = 2.1.1?

2011-09-08 Thread Ben Munge
There does seem to be a lack of valuable GWT books covering some of
the newer aspects of the language. Have you gone through all the
tutorials on the main site? I found the large scale application
development and MVP pattern w/ UIBinder tutorial extremely valuable
when learning the framework:

http://code.google.com/webtoolkit/articles/mvp-architecture-2.html

On Sep 8, 8:18 am, tom majortom...@gmail.com wrote:
 Hello,

 Does anybody know if there's a book (about to be published?) that covers the
 new features since 2.1.1 (RequestFactory, Editor framework, ...)?

 I'm working with GWT (v2.3) for a couple of weeks now, and I'm still getting
 stuck for hours on simple problems day by day. I think it's mainly because
 of a lack of thorough documentation/explanation of the mechanisms the
 framework is built upon. The Getting started guides on the project page were
 helpful to get some code together at first, but it turned out a lot of
 things aren't just working as simple.

 I have no doubt that the framework's great and that you can build great apps
 with it, but learning how to use it is so frustrating at times...

 Regards

 Tom

-- 
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.



Re: Conditional CSS Updates

2011-09-08 Thread Ben Munge
I don't think you can do this with conditional styles. I think you'd
be better off firing an event on the event bus when they orientation
changes and just change class/style through an event handler.

On Aug 29, 12:39 am, rth rthol...@gmail.com wrote:
 Hi,

 I have a Conditional CSS block that calls isPortrait() at runtime and
 correctly renders the right rule based on its return value. My problem
 is that I cannot figure out how to get the condition to be reevaluated
 in the future (e.g., when the orientation changes, I would like to
 have the conditional CSS evaluated again and the page rendered with
 the new CSS). My sample CSS is below.

 @if (org.foo.Application.isPortrait()) {
         .stats {
                 border: 3px solid red;
         }} @else {

         .stats {
                 border: 3px solid blue;
         }

 }

 The docs (http://code.google.com/webtoolkit/doc/latest/
 DevGuideClientBundle.html#Conditional_CSS) states that these
 conditions are evaluated at runtime (which I can confirm), so I am
 hoping I can somehow force the re-evaluation to happen again.

 Any pointers would be greatly appreciated.

 --rth

-- 
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.



Re: Is there a GWT book covering version = 2.1.1?

2011-09-08 Thread Ben Munge
Thanks for the tip BM!

On Sep 8, 9:57 am, BM bhushan.ma...@gmail.com wrote:
 Have you checked the Manning's GWT in Action Second Edition book? They
 have it on MEAP program. This book is awesome. They cover the latest
 2.3 version with extensive coverage on UIBinder, RPC, MVP, Activities
 and Places, RequestBuilder. They are in fact going to add chapter on
 RequestFactory also.

 This book is a must buy.

 On Sep 8, 8:18 am, tom majortom...@gmail.com wrote:







  Hello,

  Does anybody know if there's a book (about to be published?) that covers the
  new features since 2.1.1 (RequestFactory, Editor framework, ...)?

  I'm working with GWT (v2.3) for a couple of weeks now, and I'm still getting
  stuck for hours on simple problems day by day. I think it's mainly because
  of a lack of thorough documentation/explanation of the mechanisms the
  framework is built upon. The Getting started guides on the project page were
  helpful to get some code together at first, but it turned out a lot of
  things aren't just working as simple.

  I have no doubt that the framework's great and that you can build great apps
  with it, but learning how to use it is so frustrating at times...

  Regards

  Tom

-- 
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.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread Ben Munge
You create a Proxy object on the client for your corresponding server
object.

http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html


On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:
 Sometimes you want the same Java code to run on the client and server.
 With RPC it is easy to share the same object, what is the best way to
 do this with RF?
 Thank You.

-- 
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.



Re: RequestFactory Best Practices: How to share object between client and server

2011-08-04 Thread Ben Munge
You generally shouldn't be doing this from a design standpoint. If you
want to share some simple objects or utilities you could use the
shared package, but beyond that would break encapsulation. If you
could explain your requirements in a bit more detail I might be able
to provide better assistance.

On Aug 4, 11:24 am, br22 g22...@gmail.com wrote:
 Great, but how you make the SAME Java code (that runs both on the
 client and the server) share the SAME object (not 2 objects like Obj1
 and Obj1Proxy)?

 On Aug 4, 11:34 am, Ben Munge ben.mu...@gmail.com wrote:







  You create a Proxy object on the client for your corresponding server
  object.

 http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html

  On Aug 4, 5:46 am, br22 g22...@gmail.com wrote:

   Sometimes you want the same Java code to run on the client and server.
   With RPC it is easy to share the same object, what is the best way to
   do this with RF?
   Thank You.

-- 
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.



Re: Does GWT has any framework or class or something for accessibility (especially for client side )

2011-08-02 Thread Ben Munge
I'm not sure what you mean exactly. Accessibility is driven much more
by the content and construction of your pages. A framework cannot make
assumptions about accessibility because it doesn't know what your site
is trying to express. If you follow the UI Binder approach, just
construct your elements in the most accessible way that fits your site
(tab indexing, alt comments, descriptive links, etc).

On Aug 2, 12:38 am, mmb birada...@gmail.com wrote:
 Hi Everyone ,
 I just started learning GWT  ,is there any kind of framework or API's
 for client side accessibility for GWT,i know there is a library for
 provider side i.e com.google...ui.accessibility,but i want framework
 or class at the client side
 thanks in advance for those who reply..

-- 
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.



Dynamically convert between TextBox and PasswordTextBox

2011-07-29 Thread Ben Munge
I have a requirement to turn some financial fields into masked fields
and I wanted to use the password input type to simplify the logic. I
need to be able to change a TextBox to a PasswordTextBox and have it
change the value in the box to circles without affecting the value or
style of the element. I'm having trouble finding a good way to do this
as TextBox does not let you modify the type property. Any advice/help
would be greatly appreciated.

Thanks!

-- 
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.



Re: Dynamically convert between TextBox and PasswordTextBox

2011-07-29 Thread Ben Munge
Yes you should be able to, however you are not. There is no
constructor for PasswordTextBox that takes in a TextBox. I ended up
just using getElement and setting the attribute directly.

textBox.getElement().setAttribute(type, password);

On Jul 29, 3:17 pm, Gal Dolber gal.dol...@gmail.com wrote:
 From a code and css points of view they are exactly the same. You should be
 able to change from TextBox to PasswordTextBox without changing anything.









 On Fri, Jul 29, 2011 at 5:05 PM, Ben Munge ben.mu...@gmail.com wrote:
  I have a requirement to turn some financial fields into masked fields
  and I wanted to use the password input type to simplify the logic. I
  need to be able to change a TextBox to a PasswordTextBox and have it
  change the value in the box to circles without affecting the value or
  style of the element. I'm having trouble finding a good way to do this
  as TextBox does not let you modify the type property. Any advice/help
  would be greatly appreciated.

  Thanks!

  --
  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.

 --
 Guit: Elegant, beautiful, modular and *production ready* gwt applications.

 http://code.google.com/p/guit/

-- 
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.



Re: HTML ids for widgets generated in a celltable

2011-06-22 Thread Ben Munge
Just curious, but why do you need ID's? Xelibrety's solution should
work but you should be able to add any behavior you want to the
objects through GWT without the need for an ID. If you have JavaScript
that needs IDs to access them, you might as well just port Xelibrety's
code over the JavaScript in question.

On Jun 22, 6:50 am, nirav patani nirav...@gmail.com wrote:
 Hi,

     Is there a way to add html ids to widgets generated in a
 celltable. for instance i have cell table whose one column contains
 only buttons. i wantto set HTML ids for those buttons.

 Thanks.

-- 
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.



Re: Unable to load module entry point class

2011-06-21 Thread Ben Munge
Can you post your code for WelcomePage?

On Jun 20, 11:42 am, SCK guyedj...@gmail.com wrote:
 Hi,

 I'm new developer in GWT. I try somthing and when I want to Run the
 application, I get error Failed to load Module.
 See error in below:

 [ERROR] Unable to load module entry point class
 com.Habou.client.WelcomePage (see associated exception for details)
 com.google.gwt.core.client.JavaScriptException: (TypeError):
 '$wnd.Ext.StatusBar' a la valeur Null ou n'est pas un objet.
  number: -2146823281
  description: '$wnd.Ext.StatusBar' a la valeur Null ou n'est pas un
 objet.
         at com.gwtext.client.widgets.Component.checkExtVer(Native Method)
         at com.gwtext.client.widgets.Component.clinit(Component.java:108)
         at com.Habou.client.WelcomePage.createComponents(WelcomePage.java:31)
         at com.Habou.client.WelcomePage.onModuleLoad(WelcomePage.java:24)

 Thank you for your Help

-- 
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.



Re: No source code is available for type java.lang.NoSuchFieldError

2011-06-21 Thread Ben Munge
In your GWT console double click the individual errors and you should
get a more detailed stack trace. It likely is something wrong with
your code rather then a missing import/resource. I've gotten a similar
error in the past and it's not overly intuitive.

On Jun 20, 1:59 pm, Nathan Klatt n8kl...@gmail.com wrote:
 I've inherited a GWT project and I'm receiving the following compiler error
 (more info below):

 [java] [ERROR] Line 51: No source code is available for type
 java.lang.NoSuchFieldError; did you forget to inherit a required module?

 It's complaining about a core part of the language here, right? Why is it
 looking for source code for it at all? Is it not finding one of the core jar
 files? Do I need to point it at something in the ant build.xml file?

 For testing purposes, I followed all the GWT 
 instructionshttp://code.google.com/webtoolkit/gettingstarted.html,
 used webAppCreator to generate a Hello, world. app, and that builds and
 runs just fine. I added a simple try...catch(NoSuchFieldError err) - and an
 import java.lang.NoSuchFieldError line - and it gave me the error.

 I'm new to this Java/GWT stuff so I suspect I'm missing something obvious -
 I'd love it if you could point out exactly what! :)

 Thanks.

 =

 $ ant build
 Buildfile: build.xml

 libs:

 javac:
     [javac] Compiling 1 source file to
 /home/nklatt/gwt-2.3.0/MyWebApp/war/WEB-INF/classes

 gwtc:
      [java] Compiling module com.mycompany.mywebapp.MyWebApp
      [java]    Validating newly compiled units
      [java]       [ERROR] Errors in
 'file:/home/nklatt/gwt-2.3.0/MyWebApp/src/com/mycompany/mywebapp/client/MyW 
 ebApp.java'
      [java]          [ERROR] Line 51: No source code is available for type
 java.lang.NoSuchFieldError; did you forget to inherit a required module?
      [java]    Finding entry point classes
      [java]       [ERROR] Unable to find type
 'com.mycompany.mywebapp.client.MyWebApp'
      [java]          [ERROR] Hint: Previous compiler errors may have made
 this type unavailable
      [java]          [ERROR] Hint: Check the inheritance chain from your
 module; it may not be inheriting a required module or a module may not be
 adding its source path entries properly

 BUILD FAILED

-- 
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.



Re: GMail like selection combobox

2011-06-21 Thread Ben Munge
It's a pretty simple Widget. The checkbox itself is simply a standard
check box. The event would check all if clicked and unchecked all if
unchecked. The box around it is simply a div styled as a button with a
click event. The click event shows the dropdown which is simply
another collection of divs, each with their own click event to check
the checkboxes of the appropriate type. There's nothing overly unique
about the widget as a whole. Take a look at the Gmail html of the
option and it should be pretty easy to build.

On Jun 17, 4:09 pm, joel jtrun...@gmail.com wrote:
 In GMail there is a combobox that shows a checkbox, you can drop-down
 the box and get the selections such as all/none... If you click
 the checkbox it will checkmark all your emails...

 How can I make that widget with GWT?

 J

-- 
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.