Re: how to use UIbinder

2014-04-08 Thread Francesco Viscomi
Grazie Alberto; infinite grazie

Il giorno martedì 8 aprile 2014 11:28:05 UTC+2, Francesco Viscomi ha 
scritto:
>
> Hi all, i'm new on GWT;
>
> I followed the example on 
> http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html 
> the one with title Hello Widget World;
>
> and everything seems right; My answer is how i can see the word Hello able 
> baker charlie (that is what is printed in Hello.ui.xml);
>
>
>
>
> file Hello.ui.xml:
>
> ==
>
> http://dl.google.com/gwt/DTD/xhtml.ent";>
>  xmlns:g="urn:import:com.google.gwt.user.client.ui">
> 
> Hello,  visibleItemCount='1'/>.
>   
>  
>
> =
>
> file Hello.java
>
> ==
>
> package com.francesco.client;
>
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.dom.client.SpanElement;
> import com.google.gwt.uibinder.client.UiBinder;
> import com.google.gwt.user.client.ui.Composite;
> import com.google.gwt.user.client.ui.ListBox;
> import com.google.gwt.user.client.ui.Widget;
> import com.google.gwt.uibinder.client.UiField;
>
>
>
>
> public class Hello extends Composite {
>
> private static HelloUiBinder uiBinder = 
> GWT.create(HelloUiBinder.class);
> 
> @UiField ListBox listBox;
> 
> interface HelloUiBinder extends UiBinder {
> }
> 
>  public Hello(String... names) {
> // sets listBox
> initWidget(uiBinder.createAndBindUi(this));
> for (String name : names) {
>   listBox.addItem(name);
> }
>   }
>
> }
>
> 
>
> file Multitab.java
>
> ==
>
> package com.francesco.client;
>
> import com.francesco.shared.FieldVerifier;
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.dom.client.Document;
> import com.google.gwt.event.dom.client.ClickEvent;
> import com.google.gwt.event.dom.client.ClickHandler;
> import com.google.gwt.event.dom.client.KeyCodes;
> import com.google.gwt.event.dom.client.KeyUpEvent;
> import com.google.gwt.event.dom.client.KeyUpHandler;
> import com.google.gwt.user.client.rpc.AsyncCallback;
> import com.google.gwt.user.client.ui.Button;
> import com.google.gwt.user.client.ui.DialogBox;
> import com.google.gwt.user.client.ui.HTML;
> import com.google.gwt.user.client.ui.Label;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.TextBox;
> import com.google.gwt.user.client.ui.VerticalPanel;
>
> /**
>  * Entry point classes define onModuleLoad().
>  */
> public class Multitab implements EntryPoint {
> /**
>  * The message displayed to the user when the server cannot be reached 
> or
>  * returns an error.
>  */
> private static final String SERVER_ERROR = "An error occurred while "
> + "attempting to contact the server. Please check your network 
> "
> + "connection and try again.";
>
> /**
>  * Create a remote service proxy to talk to the server-side Greeting 
> service.
>  */
> private final GreetingServiceAsync greetingService = GWT
> .create(GreetingService.class);
>
> /**
>  * This is the entry point method.
>  */
> public void onModuleLoad() {
> 
> 
> Hello helloWorld = new Hello("able", "baker", "charlie");
>
> }
>
>
> 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: how to use UIbinder

2014-04-08 Thread Alberto Mancini
Hi,
I think that the problem is that TabLayoutPanel has to be used woth
LayoutPanels
(http://www.gwtproject.org/doc/latest/DevGuideUiPanels.html#LayoutPanels)
whereas i told you to use RootPanel (that is not a LayoutPanel).

Change
 RootPanel.get.add(helloWorld);
with
 RootLayoutPanel.get.add(helloWorld);

and

public class Hello extends Composite {

with

public class Hello extends ResizeComposite {

(
http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/ResizeComposite.html
)

and should work.

Cannot try your code so my respoonse may be incomplete.

Ciao,
   Alberto.





On Tue, Apr 8, 2014 at 12:20 PM, Francesco Viscomi wrote:

> Thanks Alberto;
> just another thing;
>
> I want to display the names in just one tab so i've changed the file
> Hello.ui.xml as reported below;
>
> But i'm able to view the multitab section but i cannot see the names
> anymore;
> Could you give me help once again?
>
>
> ===
> http://dl.google.com/gwt/DTD/xhtml.ent";>
>  xmlns:g="urn:import:com.google.gwt.user.client.ui">
> 
> 
>   
>  HTML header
> 
>
>  
> Hello,  visibleItemCount='1'/>.
>   
>   
>   
> 
>   Custom header
> 
> baker
>   
>  
>
>
>
> 
> ===
>
>
>
>
>
> Il giorno martedì 8 aprile 2014 11:28:05 UTC+2, Francesco Viscomi ha
> scritto:
>
>> Hi all, i'm new on GWT;
>>
>> I followed the example on http://www.gwtproject.org/doc/
>> latest/DevGuideUiBinder.html
>> the one with title Hello Widget World;
>>
>> and everything seems right; My answer is how i can see the word Hello
>> able baker charlie (that is what is printed in Hello.ui.xml);
>>
>>
>>
>>
>> file Hello.ui.xml:
>>
>> ==
>>
>> http://dl.google.com/gwt/DTD/xhtml.ent";>
>> > xmlns:g="urn:import:com.google.gwt.user.client.ui">
>> 
>> Hello, > visibleItemCount='1'/>.
>>   
>> 
>>
>> =
>>
>> file Hello.java
>>
>> ==
>>
>> package com.francesco.client;
>>
>> import com.google.gwt.core.client.GWT;
>> import com.google.gwt.dom.client.SpanElement;
>> import com.google.gwt.uibinder.client.UiBinder;
>> import com.google.gwt.user.client.ui.Composite;
>> import com.google.gwt.user.client.ui.ListBox;
>> import com.google.gwt.user.client.ui.Widget;
>> import com.google.gwt.uibinder.client.UiField;
>>
>>
>>
>>
>> public class Hello extends Composite {
>>
>> private static HelloUiBinder uiBinder = GWT.create(HelloUiBinder.
>> class);
>>
>> @UiField ListBox listBox;
>>
>> interface HelloUiBinder extends UiBinder {
>> }
>>
>>  public Hello(String... names) {
>> // sets listBox
>> initWidget(uiBinder.createAndBindUi(this));
>> for (String name : names) {
>>   listBox.addItem(name);
>> }
>>   }
>>
>> }
>>
>> 
>>
>> file Multitab.java
>>
>> ==
>>
>> package com.francesco.client;
>>
>> import com.francesco.shared.FieldVerifier;
>> import com.google.gwt.core.client.EntryPoint;
>> import com.google.gwt.core.client.GWT;
>> import com.google.gwt.dom.client.Document;
>> import com.google.gwt.event.dom.client.ClickEvent;
>> import com.google.gwt.event.dom.client.ClickHandler;
>> import com.google.gwt.event.dom.client.KeyCodes;
>> import com.google.gwt.event.dom.client.KeyUpEvent;
>> import com.google.gwt.event.dom.client.KeyUpHandler;
>> import com.google.gwt.user.client.rpc.AsyncCallback;
>> import com.google.gwt.user.client.ui.Button;
>> import com.google.gwt.user.client.ui.DialogBox;
>> import com.google.gwt.user.client.ui.HTML;
>> import com.google.gwt.user.client.ui.Label;
>> import com.google.gwt.user.client.ui.RootPanel;
>> import com.google.gwt.user.client.ui.TextBox;
>> import com.google.gwt.user.client.ui.VerticalPanel;
>>
>> /**
>>  * Entry point classes define onModuleLoad().
>>  */
>> public class Multitab implements EntryPoint {
>> /**
>>  * The message displayed to the user when the server cannot be
>> reached or
>>  * returns an error.
>>  */
>> private static final String SERVER_ERROR = "An error occurred while "
>> + "attempting to contact the server. Please check your
>> network "
>> + "connection and try again.";
>>
>> /**
>>  * Create a remote service proxy to talk to the server-side Greeting
>> service.
>>  */
>> private final GreetingServiceAsync greetingService = GWT
>> .create(GreetingService.class);
>>
>> /**
>>  * This is the entry point method.
>>  */
>> public void onModuleLoad() {
>>
>>
>> Hello helloWorld = new Hello("able", "baker", "charlie");
>>
>> }
>>
>> 

Re: how to use UIbinder

2014-04-08 Thread Francesco Viscomi
Thanks Alberto;
just another thing;

I want to display the names in just one tab so i've changed the file 
Hello.ui.xml as reported below;

But i'm able to view the multitab section but i cannot see the names 
anymore; 
Could you give me help once again?

===
http://dl.google.com/gwt/DTD/xhtml.ent";>



  
 HTML header

 
Hello, .
  
  
  

  Custom header

baker
  
 
  
 
  
 
===





Il giorno martedì 8 aprile 2014 11:28:05 UTC+2, Francesco Viscomi ha 
scritto:
>
> Hi all, i'm new on GWT;
>
> I followed the example on 
> http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html 
> the one with title Hello Widget World;
>
> and everything seems right; My answer is how i can see the word Hello able 
> baker charlie (that is what is printed in Hello.ui.xml);
>
>
>
>
> file Hello.ui.xml:
>
> ==
>
> http://dl.google.com/gwt/DTD/xhtml.ent";>
>  xmlns:g="urn:import:com.google.gwt.user.client.ui">
> 
> Hello,  visibleItemCount='1'/>.
>   
>  
>
> =
>
> file Hello.java
>
> ==
>
> package com.francesco.client;
>
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.dom.client.SpanElement;
> import com.google.gwt.uibinder.client.UiBinder;
> import com.google.gwt.user.client.ui.Composite;
> import com.google.gwt.user.client.ui.ListBox;
> import com.google.gwt.user.client.ui.Widget;
> import com.google.gwt.uibinder.client.UiField;
>
>
>
>
> public class Hello extends Composite {
>
> private static HelloUiBinder uiBinder = 
> GWT.create(HelloUiBinder.class);
> 
> @UiField ListBox listBox;
> 
> interface HelloUiBinder extends UiBinder {
> }
> 
>  public Hello(String... names) {
> // sets listBox
> initWidget(uiBinder.createAndBindUi(this));
> for (String name : names) {
>   listBox.addItem(name);
> }
>   }
>
> }
>
> 
>
> file Multitab.java
>
> ==
>
> package com.francesco.client;
>
> import com.francesco.shared.FieldVerifier;
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.dom.client.Document;
> import com.google.gwt.event.dom.client.ClickEvent;
> import com.google.gwt.event.dom.client.ClickHandler;
> import com.google.gwt.event.dom.client.KeyCodes;
> import com.google.gwt.event.dom.client.KeyUpEvent;
> import com.google.gwt.event.dom.client.KeyUpHandler;
> import com.google.gwt.user.client.rpc.AsyncCallback;
> import com.google.gwt.user.client.ui.Button;
> import com.google.gwt.user.client.ui.DialogBox;
> import com.google.gwt.user.client.ui.HTML;
> import com.google.gwt.user.client.ui.Label;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.TextBox;
> import com.google.gwt.user.client.ui.VerticalPanel;
>
> /**
>  * Entry point classes define onModuleLoad().
>  */
> public class Multitab implements EntryPoint {
> /**
>  * The message displayed to the user when the server cannot be reached 
> or
>  * returns an error.
>  */
> private static final String SERVER_ERROR = "An error occurred while "
> + "attempting to contact the server. Please check your network 
> "
> + "connection and try again.";
>
> /**
>  * Create a remote service proxy to talk to the server-side Greeting 
> service.
>  */
> private final GreetingServiceAsync greetingService = GWT
> .create(GreetingService.class);
>
> /**
>  * This is the entry point method.
>  */
> public void onModuleLoad() {
> 
> 
> Hello helloWorld = new Hello("able", "baker", "charlie");
>
> }
>
>
> 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: how to use UIbinder

2014-04-08 Thread Alberto Mancini
Hi,
you have to insert your widget into the dom:

RootPanel.get.add(helloWorld);

just before the end of onModuleLoad.

Cheers,
   Alberto




On Tue, Apr 8, 2014 at 11:28 AM, Francesco Viscomi wrote:

> Hi all, i'm new on GWT;
>
> I followed the example on
> http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html
> the one with title Hello Widget World;
>
> and everything seems right; My answer is how i can see the word Hello able
> baker charlie (that is what is printed in Hello.ui.xml);
>
>
>
>
> file Hello.ui.xml:
>
> ==
>
> http://dl.google.com/gwt/DTD/xhtml.ent";>
>  xmlns:g="urn:import:com.google.gwt.user.client.ui">
> 
> Hello,  visibleItemCount='1'/>.
>   
> 
>
> =
>
> file Hello.java
>
> ==
>
> package com.francesco.client;
>
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.dom.client.SpanElement;
> import com.google.gwt.uibinder.client.UiBinder;
> import com.google.gwt.user.client.ui.Composite;
> import com.google.gwt.user.client.ui.ListBox;
> import com.google.gwt.user.client.ui.Widget;
> import com.google.gwt.uibinder.client.UiField;
>
>
>
>
> public class Hello extends Composite {
>
> private static HelloUiBinder uiBinder =
> GWT.create(HelloUiBinder.class);
>
> @UiField ListBox listBox;
>
> interface HelloUiBinder extends UiBinder {
> }
>
>  public Hello(String... names) {
> // sets listBox
> initWidget(uiBinder.createAndBindUi(this));
> for (String name : names) {
>   listBox.addItem(name);
> }
>   }
>
> }
>
> 
>
> file Multitab.java
>
> ==
>
> package com.francesco.client;
>
> import com.francesco.shared.FieldVerifier;
> import com.google.gwt.core.client.EntryPoint;
> import com.google.gwt.core.client.GWT;
> import com.google.gwt.dom.client.Document;
> import com.google.gwt.event.dom.client.ClickEvent;
> import com.google.gwt.event.dom.client.ClickHandler;
> import com.google.gwt.event.dom.client.KeyCodes;
> import com.google.gwt.event.dom.client.KeyUpEvent;
> import com.google.gwt.event.dom.client.KeyUpHandler;
> import com.google.gwt.user.client.rpc.AsyncCallback;
> import com.google.gwt.user.client.ui.Button;
> import com.google.gwt.user.client.ui.DialogBox;
> import com.google.gwt.user.client.ui.HTML;
> import com.google.gwt.user.client.ui.Label;
> import com.google.gwt.user.client.ui.RootPanel;
> import com.google.gwt.user.client.ui.TextBox;
> import com.google.gwt.user.client.ui.VerticalPanel;
>
> /**
>  * Entry point classes define onModuleLoad().
>  */
> public class Multitab implements EntryPoint {
> /**
>  * The message displayed to the user when the server cannot be reached
> or
>  * returns an error.
>  */
> private static final String SERVER_ERROR = "An error occurred while "
> + "attempting to contact the server. Please check your network
> "
> + "connection and try again.";
>
> /**
>  * Create a remote service proxy to talk to the server-side Greeting
> service.
>  */
> private final GreetingServiceAsync greetingService = GWT
> .create(GreetingService.class);
>
> /**
>  * This is the entry point method.
>  */
> public void onModuleLoad() {
>
>
> Hello helloWorld = new Hello("able", "baker", "charlie");
>
> }
>
>
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


how to use UIbinder

2014-04-08 Thread Francesco Viscomi
Hi all, i'm new on GWT;

I followed the example on 
http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html 
the one with title Hello Widget World;

and everything seems right; My answer is how i can see the word Hello able 
baker charlie (that is what is printed in Hello.ui.xml);




file Hello.ui.xml:

==

http://dl.google.com/gwt/DTD/xhtml.ent";>


Hello, .
  
 

=

file Hello.java

==

package com.francesco.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.SpanElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.uibinder.client.UiField;




public class Hello extends Composite {

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

@UiField ListBox listBox;

interface HelloUiBinder extends UiBinder {
}

 public Hello(String... names) {
// sets listBox
initWidget(uiBinder.createAndBindUi(this));
for (String name : names) {
  listBox.addItem(name);
}
  }

}



file Multitab.java

==

package com.francesco.client;

import com.francesco.shared.FieldVerifier;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Document;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Entry point classes define onModuleLoad().
 */
public class Multitab implements EntryPoint {
/**
 * The message displayed to the user when the server cannot be reached 
or
 * returns an error.
 */
private static final String SERVER_ERROR = "An error occurred while "
+ "attempting to contact the server. Please check your network "
+ "connection and try again.";

/**
 * Create a remote service proxy to talk to the server-side Greeting 
service.
 */
private final GreetingServiceAsync greetingService = GWT
.create(GreetingService.class);

/**
 * This is the entry point method.
 */
public void onModuleLoad() {


Hello helloWorld = new Hello("able", "baker", "charlie");

}



-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: How to use UIBinder definition from Java

2010-02-10 Thread Stefano Ciccarelli
I'm already doing like you, but I'd like to try the solution #1 explained by
Thomas Broyer, so the code is from that test. The class already extends
DialogBox and I get the error reported, the extends is missing because I
done something wrong with cut&paste.
I need @Inject because that class is the Display injected in a Presenter.

I want to try that solution because I prefer to extends DialogBox.


On Wed, Feb 10, 2010 at 5:16 PM, Christian Goudreau <
goudreau.christ...@gmail.com> wrote:

> Oh no his solution #2 isn't like mine at all, lol, but anyway, do you
> really need @Inject ? There's nothing to inject in your example.
>
>
> On Wed, Feb 10, 2010 at 11:11 AM, Christian Goudreau <
> goudreau.christ...@gmail.com> wrote:
>
>> In your code, for solution #1, you need to extends DialogBox, you forgot
>> that.
>>
>> For my solution, I only encapsulate DialogBox within an HTMLPanel an then
>> I added two public function for showing and hiding my dialogbox. (Solution
>> #2) Btw, I found solution #2 less intrusive and more simple.
>>
>>
>> On Wed, Feb 10, 2010 at 10:58 AM, Stefano Ciccarelli <
>> sciccare...@gmail.com> wrote:
>>
>>> Sorry, I was talking about Thomas Broyer solution #1.
>>> Your code (pastebin) is what I was already doing.
>>>
>>> BTW this is the .java:
>>>
>>> public final class AboutDialogDisplay {
>>> @Inject
>>> private AboutDialogDisplay() {
>>> uiBinder.createAndBindUi(this);
>>> }
>>>
>>> @UiFactory
>>> DialogBox thatsJustMe() {
>>>  return this;
>>> }
>>> }
>>>
>>> And this is the .ui.xml:
>>> 
>>> ..
>>> 
>>>
>>> Thanks
>>> Stefano
>>>
>>>
>>>
>>> On Wed, Feb 10, 2010 at 4:46 PM, Christian Goudreau <
>>> goudreau.christ...@gmail.com> wrote:
>>>
 First, give us your code for you .java and for your .ui.xml.

 I'll see what  I can do for you, I also had some problems first time I
 tried this. Note that I'm using Gwt-Presenter in my example.

 Christian

 On Wed, Feb 10, 2010 at 10:24 AM, Stefano Ciccarelli <
 sciccare...@gmail.com> wrote:

> Solution #1 doesn't work for me. I get this error:
>
> Second attempt to set initializer for field "f_DialogBox1", from "new
> com.google.gwt.user.client.ui.DialogBox(false, true)" to
> "owner.thatsJustMe()"
>
> Hints or suggestions?
>
>
> On Tue, Feb 9, 2010 at 5:44 PM, Thomas Broyer wrote:
>
>>
>> On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
>> > Hello,
>> >
>> > The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
>> > javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that
>> a
>> > DialogBox can be defined as a UIBinder template as follows:
>> >
>> >  
>> >Caption text
>> >
>> >  Body text
>> >  Cancel
>> >  Okay
>> >
>> >  
>> >
>> > What is the proper way of using this definition from Java code?
>> > Supposing that the above definition is contained in
>> > NotificationWindow.ui.xml, the following naive approach to
>> > NotificationWindow.java does not work:
>> >
>> > public class NotificationWindow extends Composite {
>> > private static NotificationWindowUiBinder uiBinder =
>> > GWT.create(NotificationWindowUiBinder.class);
>> > interface NotificationWindowUiBinder extends
>> UiBinder> > NotificationWindow> {}
>> >
>> > @UiField DialogBox dialogBox;
>> >
>> > public NotificationWindow() {
>> > initWidget(uiBinder.createAndBindUi(this));
>> > }
>> >
>> > public void show() {
>> > dialogBox.show();
>> > }
>> >
>> > }
>> >
>> > If the EntryPoint-derived class calls:
>> >
>> > (new NotificationWindow()).show();
>> >
>> > then the following exception is logged:
>> >
>> > java.lang.IllegalStateException: This widget's parent does not
>> > implement HasWidgets
>> >
>> > How is the  definition from the DialogBox API used
>> > correctly from Java code?
>>
>> There are two possibilities: inheriting DialogBox or having a
>> DialogBox field (but then not inheriting a Widget).
>>
>> Solution #1: inheriting a DialogBox
>>
>> class NotificationWindow extends DialogBox {
>>   ...
>>
>>   public NotificationWindow() {
>> // we don't care about the returned value, it'll be 'this'
>> uiBinder.createAndBindUi(this);
>>   }
>>
>>   @UiFactory
>>   DialogBox thatsJustMe() {
>>  // UiBinder will call this to get a DialogBox instance
>>  // and this is the DialogBox instance we want to use
>>  return this;
>>   }
>>
>>   ...
>> }
>>
>>
>> Solution #2: not inheriting DialogBox
>>
>> // Note: do NOT inherit Composite, Widget or UIObject!
>> class NotificationWindow {
>>>

Re: How to use UIBinder definition from Java

2010-02-10 Thread Christian Goudreau
Oh no his solution #2 isn't like mine at all, lol, but anyway, do you really
need @Inject ? There's nothing to inject in your example.

On Wed, Feb 10, 2010 at 11:11 AM, Christian Goudreau <
goudreau.christ...@gmail.com> wrote:

> In your code, for solution #1, you need to extends DialogBox, you forgot
> that.
>
> For my solution, I only encapsulate DialogBox within an HTMLPanel an then I
> added two public function for showing and hiding my dialogbox. (Solution #2)
> Btw, I found solution #2 less intrusive and more simple.
>
>
> On Wed, Feb 10, 2010 at 10:58 AM, Stefano Ciccarelli <
> sciccare...@gmail.com> wrote:
>
>> Sorry, I was talking about Thomas Broyer solution #1.
>> Your code (pastebin) is what I was already doing.
>>
>> BTW this is the .java:
>>
>> public final class AboutDialogDisplay {
>> @Inject
>> private AboutDialogDisplay() {
>> uiBinder.createAndBindUi(this);
>> }
>>
>> @UiFactory
>> DialogBox thatsJustMe() {
>>  return this;
>> }
>> }
>>
>> And this is the .ui.xml:
>> 
>> ..
>> 
>>
>> Thanks
>> Stefano
>>
>>
>>
>> On Wed, Feb 10, 2010 at 4:46 PM, Christian Goudreau <
>> goudreau.christ...@gmail.com> wrote:
>>
>>> First, give us your code for you .java and for your .ui.xml.
>>>
>>> I'll see what  I can do for you, I also had some problems first time I
>>> tried this. Note that I'm using Gwt-Presenter in my example.
>>>
>>> Christian
>>>
>>> On Wed, Feb 10, 2010 at 10:24 AM, Stefano Ciccarelli <
>>> sciccare...@gmail.com> wrote:
>>>
 Solution #1 doesn't work for me. I get this error:

 Second attempt to set initializer for field "f_DialogBox1", from "new
 com.google.gwt.user.client.ui.DialogBox(false, true)" to
 "owner.thatsJustMe()"

 Hints or suggestions?


 On Tue, Feb 9, 2010 at 5:44 PM, Thomas Broyer wrote:

>
> On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
> > Hello,
> >
> > The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
> > javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that
> a
> > DialogBox can be defined as a UIBinder template as follows:
> >
> >  
> >Caption text
> >
> >  Body text
> >  Cancel
> >  Okay
> >
> >  
> >
> > What is the proper way of using this definition from Java code?
> > Supposing that the above definition is contained in
> > NotificationWindow.ui.xml, the following naive approach to
> > NotificationWindow.java does not work:
> >
> > public class NotificationWindow extends Composite {
> > private static NotificationWindowUiBinder uiBinder =
> > GWT.create(NotificationWindowUiBinder.class);
> > interface NotificationWindowUiBinder extends UiBinder > NotificationWindow> {}
> >
> > @UiField DialogBox dialogBox;
> >
> > public NotificationWindow() {
> > initWidget(uiBinder.createAndBindUi(this));
> > }
> >
> > public void show() {
> > dialogBox.show();
> > }
> >
> > }
> >
> > If the EntryPoint-derived class calls:
> >
> > (new NotificationWindow()).show();
> >
> > then the following exception is logged:
> >
> > java.lang.IllegalStateException: This widget's parent does not
> > implement HasWidgets
> >
> > How is the  definition from the DialogBox API used
> > correctly from Java code?
>
> There are two possibilities: inheriting DialogBox or having a
> DialogBox field (but then not inheriting a Widget).
>
> Solution #1: inheriting a DialogBox
>
> class NotificationWindow extends DialogBox {
>   ...
>
>   public NotificationWindow() {
> // we don't care about the returned value, it'll be 'this'
> uiBinder.createAndBindUi(this);
>   }
>
>   @UiFactory
>   DialogBox thatsJustMe() {
>  // UiBinder will call this to get a DialogBox instance
>  // and this is the DialogBox instance we want to use
>  return this;
>   }
>
>   ...
> }
>
>
> Solution #2: not inheriting DialogBox
>
> // Note: do NOT inherit Composite, Widget or UIObject!
> class NotificationWindow {
>   ...
>
>   private DialogBox dialogBox;
>
>   public NotificationWindow() {
>  dialogBox = uiBinder.createAndBind(this);
>}
>
>   public void show() {
>  dialogBox.show();
>   }
>
>...
> }
>
> --
> 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-tool...@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.goo

Re: How to use UIBinder definition from Java

2010-02-10 Thread Christian Goudreau
In your code, for solution #1, you need to extends DialogBox, you forgot
that.

For my solution, I only encapsulate DialogBox within an HTMLPanel an then I
added two public function for showing and hiding my dialogbox. (Solution #2)
Btw, I found solution #2 less intrusive and more simple.

On Wed, Feb 10, 2010 at 10:58 AM, Stefano Ciccarelli
wrote:

> Sorry, I was talking about Thomas Broyer solution #1.
> Your code (pastebin) is what I was already doing.
>
> BTW this is the .java:
>
> public final class AboutDialogDisplay {
> @Inject
> private AboutDialogDisplay() {
> uiBinder.createAndBindUi(this);
> }
>
> @UiFactory
> DialogBox thatsJustMe() {
> return this;
> }
> }
>
> And this is the .ui.xml:
> 
> ..
> 
>
> Thanks
> Stefano
>
>
>
> On Wed, Feb 10, 2010 at 4:46 PM, Christian Goudreau <
> goudreau.christ...@gmail.com> wrote:
>
>> First, give us your code for you .java and for your .ui.xml.
>>
>> I'll see what  I can do for you, I also had some problems first time I
>> tried this. Note that I'm using Gwt-Presenter in my example.
>>
>> Christian
>>
>> On Wed, Feb 10, 2010 at 10:24 AM, Stefano Ciccarelli <
>> sciccare...@gmail.com> wrote:
>>
>>> Solution #1 doesn't work for me. I get this error:
>>>
>>> Second attempt to set initializer for field "f_DialogBox1", from "new
>>> com.google.gwt.user.client.ui.DialogBox(false, true)" to
>>> "owner.thatsJustMe()"
>>>
>>> Hints or suggestions?
>>>
>>>
>>> On Tue, Feb 9, 2010 at 5:44 PM, Thomas Broyer wrote:
>>>

 On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
 > Hello,
 >
 > The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
 > javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
 > DialogBox can be defined as a UIBinder template as follows:
 >
 >  
 >Caption text
 >
 >  Body text
 >  Cancel
 >  Okay
 >
 >  
 >
 > What is the proper way of using this definition from Java code?
 > Supposing that the above definition is contained in
 > NotificationWindow.ui.xml, the following naive approach to
 > NotificationWindow.java does not work:
 >
 > public class NotificationWindow extends Composite {
 > private static NotificationWindowUiBinder uiBinder =
 > GWT.create(NotificationWindowUiBinder.class);
 > interface NotificationWindowUiBinder extends UiBinder>>> > NotificationWindow> {}
 >
 > @UiField DialogBox dialogBox;
 >
 > public NotificationWindow() {
 > initWidget(uiBinder.createAndBindUi(this));
 > }
 >
 > public void show() {
 > dialogBox.show();
 > }
 >
 > }
 >
 > If the EntryPoint-derived class calls:
 >
 > (new NotificationWindow()).show();
 >
 > then the following exception is logged:
 >
 > java.lang.IllegalStateException: This widget's parent does not
 > implement HasWidgets
 >
 > How is the  definition from the DialogBox API used
 > correctly from Java code?

 There are two possibilities: inheriting DialogBox or having a
 DialogBox field (but then not inheriting a Widget).

 Solution #1: inheriting a DialogBox

 class NotificationWindow extends DialogBox {
   ...

   public NotificationWindow() {
 // we don't care about the returned value, it'll be 'this'
 uiBinder.createAndBindUi(this);
   }

   @UiFactory
   DialogBox thatsJustMe() {
  // UiBinder will call this to get a DialogBox instance
  // and this is the DialogBox instance we want to use
  return this;
   }

   ...
 }


 Solution #2: not inheriting DialogBox

 // Note: do NOT inherit Composite, Widget or UIObject!
 class NotificationWindow {
   ...

   private DialogBox dialogBox;

   public NotificationWindow() {
  dialogBox = uiBinder.createAndBind(this);
}

   public void show() {
  dialogBox.show();
   }

...
 }

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


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

Re: How to use UIBinder definition from Java

2010-02-10 Thread Stefano Ciccarelli
Sorry, I was talking about Thomas Broyer solution #1.
Your code (pastebin) is what I was already doing.

BTW this is the .java:

public final class AboutDialogDisplay {
@Inject
private AboutDialogDisplay() {
uiBinder.createAndBindUi(this);
}

@UiFactory
DialogBox thatsJustMe() {
return this;
}
}

And this is the .ui.xml:

..


Thanks
Stefano



On Wed, Feb 10, 2010 at 4:46 PM, Christian Goudreau <
goudreau.christ...@gmail.com> wrote:

> First, give us your code for you .java and for your .ui.xml.
>
> I'll see what  I can do for you, I also had some problems first time I
> tried this. Note that I'm using Gwt-Presenter in my example.
>
> Christian
>
> On Wed, Feb 10, 2010 at 10:24 AM, Stefano Ciccarelli <
> sciccare...@gmail.com> wrote:
>
>> Solution #1 doesn't work for me. I get this error:
>>
>> Second attempt to set initializer for field "f_DialogBox1", from "new
>> com.google.gwt.user.client.ui.DialogBox(false, true)" to
>> "owner.thatsJustMe()"
>>
>> Hints or suggestions?
>>
>>
>> On Tue, Feb 9, 2010 at 5:44 PM, Thomas Broyer  wrote:
>>
>>>
>>> On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
>>> > Hello,
>>> >
>>> > The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
>>> > javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
>>> > DialogBox can be defined as a UIBinder template as follows:
>>> >
>>> >  
>>> >Caption text
>>> >
>>> >  Body text
>>> >  Cancel
>>> >  Okay
>>> >
>>> >  
>>> >
>>> > What is the proper way of using this definition from Java code?
>>> > Supposing that the above definition is contained in
>>> > NotificationWindow.ui.xml, the following naive approach to
>>> > NotificationWindow.java does not work:
>>> >
>>> > public class NotificationWindow extends Composite {
>>> > private static NotificationWindowUiBinder uiBinder =
>>> > GWT.create(NotificationWindowUiBinder.class);
>>> > interface NotificationWindowUiBinder extends UiBinder>> > NotificationWindow> {}
>>> >
>>> > @UiField DialogBox dialogBox;
>>> >
>>> > public NotificationWindow() {
>>> > initWidget(uiBinder.createAndBindUi(this));
>>> > }
>>> >
>>> > public void show() {
>>> > dialogBox.show();
>>> > }
>>> >
>>> > }
>>> >
>>> > If the EntryPoint-derived class calls:
>>> >
>>> > (new NotificationWindow()).show();
>>> >
>>> > then the following exception is logged:
>>> >
>>> > java.lang.IllegalStateException: This widget's parent does not
>>> > implement HasWidgets
>>> >
>>> > How is the  definition from the DialogBox API used
>>> > correctly from Java code?
>>>
>>> There are two possibilities: inheriting DialogBox or having a
>>> DialogBox field (but then not inheriting a Widget).
>>>
>>> Solution #1: inheriting a DialogBox
>>>
>>> class NotificationWindow extends DialogBox {
>>>   ...
>>>
>>>   public NotificationWindow() {
>>> // we don't care about the returned value, it'll be 'this'
>>> uiBinder.createAndBindUi(this);
>>>   }
>>>
>>>   @UiFactory
>>>   DialogBox thatsJustMe() {
>>>  // UiBinder will call this to get a DialogBox instance
>>>  // and this is the DialogBox instance we want to use
>>>  return this;
>>>   }
>>>
>>>   ...
>>> }
>>>
>>>
>>> Solution #2: not inheriting DialogBox
>>>
>>> // Note: do NOT inherit Composite, Widget or UIObject!
>>> class NotificationWindow {
>>>   ...
>>>
>>>   private DialogBox dialogBox;
>>>
>>>   public NotificationWindow() {
>>>  dialogBox = uiBinder.createAndBind(this);
>>>}
>>>
>>>   public void show() {
>>>  dialogBox.show();
>>>   }
>>>
>>>...
>>> }
>>>
>>> --
>>> 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.
>>>
>>>
>>  --
>> 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-tool...@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.
>>
>
>  --
> 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-tool...@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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to th

Re: How to use UIBinder definition from Java

2010-02-10 Thread Christian Goudreau
First, give us your code for you .java and for your .ui.xml.

I'll see what  I can do for you, I also had some problems first time I tried
this. Note that I'm using Gwt-Presenter in my example.

Christian

On Wed, Feb 10, 2010 at 10:24 AM, Stefano Ciccarelli
wrote:

> Solution #1 doesn't work for me. I get this error:
>
> Second attempt to set initializer for field "f_DialogBox1", from "new
> com.google.gwt.user.client.ui.DialogBox(false, true)" to
> "owner.thatsJustMe()"
>
> Hints or suggestions?
>
>
> On Tue, Feb 9, 2010 at 5:44 PM, Thomas Broyer  wrote:
>
>>
>> On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
>> > Hello,
>> >
>> > The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
>> > javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
>> > DialogBox can be defined as a UIBinder template as follows:
>> >
>> >  
>> >Caption text
>> >
>> >  Body text
>> >  Cancel
>> >  Okay
>> >
>> >  
>> >
>> > What is the proper way of using this definition from Java code?
>> > Supposing that the above definition is contained in
>> > NotificationWindow.ui.xml, the following naive approach to
>> > NotificationWindow.java does not work:
>> >
>> > public class NotificationWindow extends Composite {
>> > private static NotificationWindowUiBinder uiBinder =
>> > GWT.create(NotificationWindowUiBinder.class);
>> > interface NotificationWindowUiBinder extends UiBinder> > NotificationWindow> {}
>> >
>> > @UiField DialogBox dialogBox;
>> >
>> > public NotificationWindow() {
>> > initWidget(uiBinder.createAndBindUi(this));
>> > }
>> >
>> > public void show() {
>> > dialogBox.show();
>> > }
>> >
>> > }
>> >
>> > If the EntryPoint-derived class calls:
>> >
>> > (new NotificationWindow()).show();
>> >
>> > then the following exception is logged:
>> >
>> > java.lang.IllegalStateException: This widget's parent does not
>> > implement HasWidgets
>> >
>> > How is the  definition from the DialogBox API used
>> > correctly from Java code?
>>
>> There are two possibilities: inheriting DialogBox or having a
>> DialogBox field (but then not inheriting a Widget).
>>
>> Solution #1: inheriting a DialogBox
>>
>> class NotificationWindow extends DialogBox {
>>   ...
>>
>>   public NotificationWindow() {
>> // we don't care about the returned value, it'll be 'this'
>> uiBinder.createAndBindUi(this);
>>   }
>>
>>   @UiFactory
>>   DialogBox thatsJustMe() {
>>  // UiBinder will call this to get a DialogBox instance
>>  // and this is the DialogBox instance we want to use
>>  return this;
>>   }
>>
>>   ...
>> }
>>
>>
>> Solution #2: not inheriting DialogBox
>>
>> // Note: do NOT inherit Composite, Widget or UIObject!
>> class NotificationWindow {
>>   ...
>>
>>   private DialogBox dialogBox;
>>
>>   public NotificationWindow() {
>>  dialogBox = uiBinder.createAndBind(this);
>>}
>>
>>   public void show() {
>>  dialogBox.show();
>>   }
>>
>>...
>> }
>>
>> --
>> 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-tool...@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.
>>
>>
>  --
> 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-tool...@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.
>

-- 
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-tool...@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: How to use UIBinder definition from Java

2010-02-10 Thread Stefano Ciccarelli
Solution #1 doesn't work for me. I get this error:

Second attempt to set initializer for field "f_DialogBox1", from "new
com.google.gwt.user.client.ui.DialogBox(false, true)" to
"owner.thatsJustMe()"

Hints or suggestions?


On Tue, Feb 9, 2010 at 5:44 PM, Thomas Broyer  wrote:

>
> On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
> > Hello,
> >
> > The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
> > javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
> > DialogBox can be defined as a UIBinder template as follows:
> >
> >  
> >Caption text
> >
> >  Body text
> >  Cancel
> >  Okay
> >
> >  
> >
> > What is the proper way of using this definition from Java code?
> > Supposing that the above definition is contained in
> > NotificationWindow.ui.xml, the following naive approach to
> > NotificationWindow.java does not work:
> >
> > public class NotificationWindow extends Composite {
> > private static NotificationWindowUiBinder uiBinder =
> > GWT.create(NotificationWindowUiBinder.class);
> > interface NotificationWindowUiBinder extends UiBinder > NotificationWindow> {}
> >
> > @UiField DialogBox dialogBox;
> >
> > public NotificationWindow() {
> > initWidget(uiBinder.createAndBindUi(this));
> > }
> >
> > public void show() {
> > dialogBox.show();
> > }
> >
> > }
> >
> > If the EntryPoint-derived class calls:
> >
> > (new NotificationWindow()).show();
> >
> > then the following exception is logged:
> >
> > java.lang.IllegalStateException: This widget's parent does not
> > implement HasWidgets
> >
> > How is the  definition from the DialogBox API used
> > correctly from Java code?
>
> There are two possibilities: inheriting DialogBox or having a
> DialogBox field (but then not inheriting a Widget).
>
> Solution #1: inheriting a DialogBox
>
> class NotificationWindow extends DialogBox {
>   ...
>
>   public NotificationWindow() {
> // we don't care about the returned value, it'll be 'this'
> uiBinder.createAndBindUi(this);
>   }
>
>   @UiFactory
>   DialogBox thatsJustMe() {
>  // UiBinder will call this to get a DialogBox instance
>  // and this is the DialogBox instance we want to use
>  return this;
>   }
>
>   ...
> }
>
>
> Solution #2: not inheriting DialogBox
>
> // Note: do NOT inherit Composite, Widget or UIObject!
> class NotificationWindow {
>   ...
>
>   private DialogBox dialogBox;
>
>   public NotificationWindow() {
>  dialogBox = uiBinder.createAndBind(this);
>}
>
>   public void show() {
>  dialogBox.show();
>   }
>
>...
> }
>
> --
> 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-tool...@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.
>
>

-- 
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-tool...@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: How to use UIBinder definition from Java

2010-02-09 Thread Thomas Broyer

On Feb 9, 12:00 pm, Ovidiu Gheorghies  wrote:
> Hello,
>
> The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
> javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
> DialogBox can be defined as a UIBinder template as follows:
>
>  
>    Caption text
>    
>      Body text
>      Cancel
>      Okay
>    
>  
>
> What is the proper way of using this definition from Java code?
> Supposing that the above definition is contained in
> NotificationWindow.ui.xml, the following naive approach to
> NotificationWindow.java does not work:
>
> public class NotificationWindow extends Composite {
>         private static NotificationWindowUiBinder uiBinder =
> GWT.create(NotificationWindowUiBinder.class);
>         interface NotificationWindowUiBinder extends UiBinder NotificationWindow> {}
>
>         @UiField DialogBox dialogBox;
>
>         public NotificationWindow() {
>                 initWidget(uiBinder.createAndBindUi(this));
>         }
>
>         public void show() {
>             dialogBox.show();
>     }
>
> }
>
> If the EntryPoint-derived class calls:
>
> (new NotificationWindow()).show();
>
> then the following exception is logged:
>
> java.lang.IllegalStateException: This widget's parent does not
> implement HasWidgets
>
> How is the  definition from the DialogBox API used
> correctly from Java code?

There are two possibilities: inheriting DialogBox or having a
DialogBox field (but then not inheriting a Widget).

Solution #1: inheriting a DialogBox

class NotificationWindow extends DialogBox {
   ...

   public NotificationWindow() {
 // we don't care about the returned value, it'll be 'this'
 uiBinder.createAndBindUi(this);
   }

   @UiFactory
   DialogBox thatsJustMe() {
  // UiBinder will call this to get a DialogBox instance
  // and this is the DialogBox instance we want to use
  return this;
   }

   ...
}


Solution #2: not inheriting DialogBox

// Note: do NOT inherit Composite, Widget or UIObject!
class NotificationWindow {
   ...

   private DialogBox dialogBox;

   public NotificationWindow() {
  dialogBox = uiBinder.createAndBind(this);
   }

   public void show() {
  dialogBox.show();
   }

   ...
}

-- 
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-tool...@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: How to use UIBinder definition from Java

2010-02-09 Thread Christian Goudreau
That's how :

http://pastie.org/816302

Christian

On Tue, Feb 9, 2010 at 6:00 AM, Ovidiu Gheorghies wrote:

> Hello,
>
> The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
> javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
> DialogBox can be defined as a UIBinder template as follows:
>
>  
>   Caption text
>   
> Body text
> Cancel
> Okay
>   
>  
>
> What is the proper way of using this definition from Java code?
> Supposing that the above definition is contained in
> NotificationWindow.ui.xml, the following naive approach to
> NotificationWindow.java does not work:
>
> public class NotificationWindow extends Composite {
>private static NotificationWindowUiBinder uiBinder =
> GWT.create(NotificationWindowUiBinder.class);
>interface NotificationWindowUiBinder extends UiBinder NotificationWindow> {}
>
>@UiField DialogBox dialogBox;
>
>public NotificationWindow() {
>initWidget(uiBinder.createAndBindUi(this));
>}
>
>public void show() {
>dialogBox.show();
>}
> }
>
> If the EntryPoint-derived class calls:
>
> (new NotificationWindow()).show();
>
> then the following exception is logged:
>
> java.lang.IllegalStateException: This widget's parent does not
> implement HasWidgets
>
> How is the  definition from the DialogBox API used
> correctly from Java code?
>
> Best regards,
> Ovidiu
>
> --
> 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-tool...@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.
>
>

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



How to use UIBinder definition from Java

2010-02-09 Thread Ovidiu Gheorghies
Hello,

The DialogBox API (http://google-web-toolkit.googlecode.com/svn/
javadoc/2.0/com/google/gwt/user/client/ui/DialogBox.html) notes that a
DialogBox can be defined as a UIBinder template as follows:

 
   Caption text
   
 Body text
 Cancel
 Okay
   
 

What is the proper way of using this definition from Java code?
Supposing that the above definition is contained in
NotificationWindow.ui.xml, the following naive approach to
NotificationWindow.java does not work:

public class NotificationWindow extends Composite {
private static NotificationWindowUiBinder uiBinder =
GWT.create(NotificationWindowUiBinder.class);
interface NotificationWindowUiBinder extends UiBinder {}

@UiField DialogBox dialogBox;

public NotificationWindow() {
initWidget(uiBinder.createAndBindUi(this));
}

public void show() {
dialogBox.show();
}
}

If the EntryPoint-derived class calls:

(new NotificationWindow()).show();

then the following exception is logged:

java.lang.IllegalStateException: This widget's parent does not
implement HasWidgets

How is the  definition from the DialogBox API used
correctly from Java code?

Best regards,
Ovidiu

-- 
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-tool...@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: How to use UIBinder

2010-01-22 Thread Iqbal Yusuf Dipu
GWT UiBinder “helloworld” with HTML
http://wp.me/PnkVx-L

-- 
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-tool...@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: How to use UIBinder to create customized tags

2010-01-04 Thread Rick
Hi

You need to write your own parser taking clue from
DockLayoutPanelParser. Then You need to register this parser in
UIBinderWriter's registerParsers() method.

Feel free if I can further help.

Thanks and regards

Rick

On Jan 4, 6:11 pm, Hans Speijer  wrote:
> Any news on this topic? Could you be a bit more specific on how you
> patched UIBinderWriter?
>
> On Dec 24 2009, 5:15 am, Rick  wrote:
>
>
>
> > Thanks Thomas
>
> > I am successful to create mycustomizedtag by patching UIBinderWriter
> > -> registerParsers() method. I think GWT has done most of the work for
> > supportingcustomizedtag but keeping it private.

--

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-tool...@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: How to use UIBinder to create customized tags

2010-01-04 Thread Hans Speijer
Any news on this topic? Could you be a bit more specific on how you
patched UIBinderWriter?

On Dec 24 2009, 5:15 am, Rick  wrote:
> Thanks Thomas
>
> I am successful to create my customized tag by patching UIBinderWriter
> -> registerParsers() method. I think GWT has done most of the work for
> supporting customized tag but keeping it private.
>

--

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-tool...@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: How to use UIBinder

2009-12-31 Thread Wrenbjor
I wish someone @ Google or a well versed GWT dev could but together a
screen cast on UIBinder, I am so lost

On Dec 15, 10:33 am, Tristan  wrote:
> Aside from official docs I haven't seen much (and I've been looking
> because of Gin and UiBinder issues I've been having)
>
> If anyone is putting together a tutorial, it'd be great if you showed
> how to use GIN effectively in a non-trivial example (so, an injected
> view dependent on other injected views would be great!).
>
> On Dec 15, 2:13 am, Nian Zhang  wrote:
>
>
>
> > The UiBInder is diffcult to use, may be it's easy for the developers
> > who were familiar with it, but to the new one, iit's hard to start, so
> > is there anytutorialsabout this?
>
> > 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-tool...@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: How to use UIBinder to create customized tags

2009-12-23 Thread Rick
Thanks Thomas

I am successful to create my customized tag by patching UIBinderWriter
-> registerParsers() method. I think GWT has done most of the work for
supporting customized tag but keeping it private.

On Dec 23, 6:48 pm, Thomas Broyer  wrote:
> On Dec 22, 5:28 am, Rick  wrote:
>
> > Thanks Thomas
>
> > Widgets are now adding by implementing HasWidgets interface.
>
> > But I need to do a little more. As there are tags in DockLayoutPanel
> > -- , ,  in the same way, I want to create my own
> > customized tags like , etc so that I can arrange my
> > layout accordingly. Can it be possible. If it is, kindly let me know
> > as it will be a great help for me to design my UI with more
> > flexibility,
>
> This is planned, but not yet available (there's a TODO in the code),
> unless of course you patch 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-tool...@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: How to use UIBinder to create customized tags

2009-12-23 Thread Thomas Broyer


On Dec 22, 5:28 am, Rick  wrote:
> Thanks Thomas
>
> Widgets are now adding by implementing HasWidgets interface.
>
> But I need to do a little more. As there are tags in DockLayoutPanel
> -- , ,  in the same way, I want to create my own
> customized tags like , etc so that I can arrange my
> layout accordingly. Can it be possible. If it is, kindly let me know
> as it will be a great help for me to design my UI with more
> flexibility,

This is planned, but not yet available (there's a TODO in the code),
unless of course you patch 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-tool...@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: How to use UIBinder to create customized tags

2009-12-23 Thread Rick
Any idea friends???

I request from GWT members to reply this post please.

Regards

Rick

On Dec 22, 9:28 am, Rick  wrote:
> Thanks Thomas
>
> Widgets are now adding by implementing HasWidgets interface.
>
> But I need to do a little more. As there are tags in DockLayoutPanel
> -- , ,  in the same way, I want to create my own
> customized tags like , etc so that I can arrange my
> layout accordingly. Can it be possible. If it is, kindly let me know
> as it will be a great help for me to design my UI with more
> flexibility,
>
> On Dec 21, 7:44 pm, Thomas Broyer  wrote:
>
> > On Dec 21, 12:13 pm, Rick  wrote:
>
> > > Hi all
>
> > > As GWT is adding widgets in Horizontal panel, in the same way I want
> > > to get element in my composite widgets so that I can manage their
> > > layout in onAttach means I want to get label and html in RComposite
> > > widget's on attach.
>
> > > ui.xml
> > >  > >         xmlns:g='urn:import:com.google.gwt.user.client.ui'
> > >         xmlns:my='urn:import:gwt.testui.client'>
>
> > >         
>
> > >         My Widgets
> > >         in a row
>
> > >         
>
> > > 
> > > -->RCompositeWidget
> > > public class RCompositeWidget extends Composite {
> > >         public RCompositeWidget() {
> > >                 HorizontalPanel hp = new HorizontalPanel();
> > >                 initWidget(hp);
> > >         }
>
> > > }
>
> > > But I am getting following exception:
> > >         In com.google.gwt.uibinder.rebind.xmlelemen...@870aad, found
> > > unexpected child ""
>
> > RCompositeWidget has to implement HasWidgets if it's meant to be a
> > widget container, otherwise how wouldUiBinderadd the widgets to it?
> > Actually,UiBinderdoes not know that RCompositeWidget internally uses
> > an HorizontalPanel.

--

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-tool...@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: How to use UIBinder to create customized tags

2009-12-21 Thread Rick

Thanks Thomas

Widgets are now adding by implementing HasWidgets interface.

But I need to do a little more. As there are tags in DockLayoutPanel
-- , ,  in the same way, I want to create my own
customized tags like , etc so that I can arrange my
layout accordingly. Can it be possible. If it is, kindly let me know
as it will be a great help for me to design my UI with more
flexibility,

On Dec 21, 7:44 pm, Thomas Broyer  wrote:
> On Dec 21, 12:13 pm, Rick  wrote:
>
>
>
> > Hi all
>
> > As GWT is adding widgets in Horizontal panel, in the same way I want
> > to get element in my composite widgets so that I can manage their
> > layout in onAttach means I want to get label and html in RComposite
> > widget's on attach.
>
> > ui.xml
> >  >         xmlns:g='urn:import:com.google.gwt.user.client.ui'
> >         xmlns:my='urn:import:gwt.testui.client'>
>
> >         
>
> >         My Widgets
> >         in a row
>
> >         
>
> > 
> > -->RCompositeWidget
> > public class RCompositeWidget extends Composite {
> >         public RCompositeWidget() {
> >                 HorizontalPanel hp = new HorizontalPanel();
> >                 initWidget(hp);
> >         }
>
> > }
>
> > But I am getting following exception:
> >         In com.google.gwt.uibinder.rebind.xmlelemen...@870aad, found
> > unexpected child ""
>
> RCompositeWidget has to implement HasWidgets if it's meant to be a
> widget container, otherwise how wouldUiBinderadd the widgets to it?
> Actually,UiBinderdoes not know that RCompositeWidget internally uses
> an HorizontalPanel.

--

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-tool...@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: How to use UIBinder with customized composite widget

2009-12-21 Thread Rohit Bansal
Thanks Thomas

Widgets are now adding by implementing HasWidgets interface. But I need to
do a little more. As there are tags in DockLayoutPanel -- ,
,  in the same way, I want to create my own customized tags like
, etc so that I can arrange my layout accordingly. Can it
be possible. If it is, kindly let me know as it will be a great help for me
to design my UI with more flexibility.

Regards

Rick

On Mon, Dec 21, 2009 at 8:14 PM, Thomas Broyer  wrote:

>
>
> On Dec 21, 12:13 pm, Rick  wrote:
> > Hi all
> >
> > As GWT is adding widgets in Horizontal panel, in the same way I want
> > to get element in my composite widgets so that I can manage their
> > layout in onAttach means I want to get label and html in RComposite
> > widget's on attach.
> >
> > ui.xml
> >  > xmlns:g='urn:import:com.google.gwt.user.client.ui'
> > xmlns:my='urn:import:gwt.testui.client'>
> >
> > 
> >
> > My Widgets
> > in a row
> >
> > 
> >
> > 
> > -->RCompositeWidget
> > public class RCompositeWidget extends Composite {
> > public RCompositeWidget() {
> > HorizontalPanel hp = new HorizontalPanel();
> > initWidget(hp);
> > }
> >
> > }
> >
> > But I am getting following exception:
> > In com.google.gwt.uibinder.rebind.xmlelemen...@870aad, found
> > unexpected child ""
>
> RCompositeWidget has to implement HasWidgets if it's meant to be a
> widget container, otherwise how would UiBinder add the widgets to it?
> Actually, UiBinder does not know that RCompositeWidget internally uses
> an HorizontalPanel.
>
> --
>
> 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-tool...@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.
>
>
>

--

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-tool...@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: How to use UIBinder with customized composite widget

2009-12-21 Thread Thomas Broyer


On Dec 21, 12:13 pm, Rick  wrote:
> Hi all
>
> As GWT is adding widgets in Horizontal panel, in the same way I want
> to get element in my composite widgets so that I can manage their
> layout in onAttach means I want to get label and html in RComposite
> widget's on attach.
>
> ui.xml
>          xmlns:g='urn:import:com.google.gwt.user.client.ui'
>         xmlns:my='urn:import:gwt.testui.client'>
>
>         
>
>         My Widgets
>         in a row
>
>         
>
> 
> -->RCompositeWidget
> public class RCompositeWidget extends Composite {
>         public RCompositeWidget() {
>                 HorizontalPanel hp = new HorizontalPanel();
>                 initWidget(hp);
>         }
>
> }
>
> But I am getting following exception:
>         In com.google.gwt.uibinder.rebind.xmlelemen...@870aad, found
> unexpected child ""

RCompositeWidget has to implement HasWidgets if it's meant to be a
widget container, otherwise how would UiBinder add the widgets to it?
Actually, UiBinder does not know that RCompositeWidget internally uses
an HorizontalPanel.

--

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




How to use UIBinder with customized composite widget

2009-12-21 Thread Rick
Hi all

As GWT is adding widgets in Horizontal panel, in the same way I want
to get element in my composite widgets so that I can manage their
layout in onAttach means I want to get label and html in RComposite
widget's on attach.

ui.xml




My Widgets
in a row






-->RCompositeWidget
public class RCompositeWidget extends Composite {
public RCompositeWidget() {
HorizontalPanel hp = new HorizontalPanel();
initWidget(hp);
}

}

But I am getting following exception:
In com.google.gwt.uibinder.rebind.xmlelemen...@870aad, found
unexpected child ""

Regards

Rick

--

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-tool...@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: How to use UIBinder

2009-12-15 Thread Tristan
Aside from official docs I haven't seen much (and I've been looking
because of Gin and UiBinder issues I've been having)

If anyone is putting together a tutorial, it'd be great if you showed
how to use GIN effectively in a non-trivial example (so, an injected
view dependent on other injected views would be great!).



On Dec 15, 2:13 am, Nian Zhang  wrote:
> The UiBInder is diffcult to use, may be it's easy for the developers
> who were familiar with it, but to the new one, iit's hard to start, so
> is there any tutorials about this?
>
> 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-tool...@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.




How to use UIBinder

2009-12-15 Thread Nian Zhang
The UiBInder is diffcult to use, may be it's easy for the developers
who were familiar with it, but to the new one, iit's hard to start, so
is there any tutorials about this?

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