This is where I highly recommend spending a few moments with the documentation as not only with GWT Designer do exactly what you want, it will do a great deal more than this. You have full control over the code gen process to a much finer level of granularity than you may even want. You can globally or individually control the field/local status of any widget or type of widget. You can easily set it up such that TextBoxes are fields and Labels are local variables by default.
http://code.google.com/webtoolkit/tools/gwtdesigner/preferences/gwt/preferences_code_generation.html http://code.google.com/webtoolkit/tools/gwtdesigner/preferences/gwt/preferences_variables.html http://code.google.com/webtoolkit/tools/gwtdesigner/userinterface/property_pane_context_menu.html On Nov 22, 1:50 am, Noor <[email protected]> wrote: > Hello, > > I am new to GWT but I've been using java object orientation > programming for quite a long. The problem is that when gwt designer > generates the code for the user interface. It defines the components > directly in the construction which is problem when we try to access > the component outside the constructor. > > e.g. This is how gwt designer would generate code for the UI with 1 > textbox > > public class View() > { > View() > { > TextBox Username= new TextBox(); > } > > } > > I wanted it to generate like this: > public class View() > { > private TextBox Username; > View() > { > Username= new TextBox(); > } > > } > > Like this, the component will be accessible everywhere. > > Is this possible for configure the generation of the code else I think > google should implement it this way because it is more dynamic -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
