Question on ConditionalProperties

2012-11-15 Thread FKereki
Hi!

I was just checking the Wiki page on Conditional Properties, and I think an 
example is off by one.

Given:

define-property name=mobile.user.agent values=android, iphone, 
not_mobile /

property-provider name=mobile.user.agent![CDATA[
  {
var ua = window.navigator.userAgent.toLowerCase();
if (ua.indexOf('android') != -1) { return 'android'; }
if (ua.indexOf('iphone') != -1) { return 'iphone'; }
return 'not_mobile';
  }
]]/property-provider

!-- Constrain the value for non-webkit browsers --
set-property name=mobile.user.agent value=not_mobile 
  none !-- Actually means NOR, in this case not safari --
when-property-is name=user.agent value=safari /
  /none
/set-property


the text says instead of having [user.agent] * [mobile.user.agent] = 6 * 3 
= 18 permutations, this will produce [user.agent] + [mobile.user.agent] = 
9permutations.

As I see it, five of the possible user.agent values (i.e., everything but 
Safari) will each produce a combination (for 
mobile.user.agent=not_mobile), and when user.agent *is* Safari, it will 
produce three combinations, for each mobile.user.agent value -- and that 
comes out to 8, not 9. Am I missing anything?


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/feb9XbXxfvgJ.
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.



A MVP widget within a View

2010-12-06 Thread FKereki
Hi!

I've been playing with the MVP framework, and I'm thinking about
designing a widge (in MVP fashion, naturally!) and including it within
another MVP form.

I worked with this in ESSENTIAL GWT, but I'm not seeing my way now
with activities  places... any hints, so to avoid overloading my
tired brain cells?

-- 
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: Does these books still compatible with the new GWT ?

2010-08-13 Thread FKereki
My own ESSENTIAL GWT is now out, and is geared towards GWT 2, so I
think it will suit you. You can find it at Amazon.com and other online
bookshops.

Best regards,
F.Kereki

-- 
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: New book, ESSENTIAL GWT

2010-06-17 Thread FKereki
Thanks for the reference. I can add the index of the book:

Chapter 1. Developing Your Application - Rich Internet Applications;
Advantages of GWT; Software Methodologies to Apply
Chapter 2. Getting Started with GWT 2.0 - Why use GWT?; The GWT
Components; Setting GWT Up
Chapter 3. Understanding Projects and Development - Creating a
Project; Project Structure; Running your Application: Development Mode
Chapter 4. Working with Browsers - The “Back Button” Problem;
Detecting the User’s Browser (including deferred binding and code
generators)
Chapter 5. Programming the User Interface - Thinking about UI
Patterns; Implementing MVP; Some Extensions; Declarative UI (including
UiBinder)
Chapter 6. Communicating with Your Server - Introduction to RPC; RPC
Patterns of Usage
Chapter 7. Communicating with Other Servers - The Same Origin Policy
(SOP) Restriction; Our City Update Application; Receiving and
Processing XML; Producing and Sending XML
Chapter 8. Mixing in JavaScript - JSNI; JSON; JSONP
Chapter 9. Adding APIs - A Weather Vane; Dashboard Visualizations;
Working with Maps
Chapter 10. Working with Servers - The Challenges to Meet;
Cryptography; Stateless vs Stateful Servers; Common Operations
Chapter 11. Moving Around Files - Uploading Files; Downloading Files
Chapter 12. Internationalization and Localization -
Internationalization (i18n); Localization (l10n)
Chapter 13. Testing your GWT Application - Why Testing?; Unit Testing
with JUnit; Integration Testing with GWTTestCase; Acceptance Testing
with Selenium
Chapter 14. Optimizing for Application Speed - Design Patterns for
Speed; Speed Measurement Tools
Chapter 15. Deploying Your Application - Compilation; Modules; Code
Splitting; Deployment


Best regards,
F.Kereki


On Jun 16, 6:20 pm, Jim Douglas jdoug...@basis.com wrote:
 Frederic --

 You can find summary information on Amazon:

 http://www.amazon.com/gp/product/product-description/0321705149

 And you can read chapter 1 here:

 http://my.safaribooksonline.com/9780321705631

 On Jun 16, 12:31 pm, Frederic Conrotte frederic.conro...@gmail.com
 wrote:

  Can you summarize what kind of new information this book gives in
  comparison with previous books ?

  On 16 juin, 17:32, FKereki fker...@gmail.com wrote:

   Hi!

   I'm quite proud to be able to announce I wrote a book for Addison-
   Wesley, called ESSENTIAL GWT.

   The book is available online 
   athttp://my.safaribooksonline.com/9780321705631
   and also (for preorders) in Amazon.com 
   athttp://www.amazon.com/Federico-Kereki/e/B003NE73LE
   or Barnes and Noble 
   athttp://search.barnesandnoble.com/Essential-GWT/Federico-Kereki/e/9780...

   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: New book, ESSENTIAL GWT

2010-06-17 Thread FKereki
Hi!

This book is geared towards GWT 2, including all its new features. I
cover items such as UiBinder, code generators, deferred binding, MVP,
etc. Quoting from the preface of the book:

Chapters 1 through 3 deal with the basic setup for working with GWT.
After considering the main reasons and objectives for using GWT, we
shall study what other tools are required for serious code
development, the methodology to use, and the internal aspects of
projects.

Chapters 4 and 5 are really a backbone for the book, for they deal
with the basic design patterns that we shall use for building the User
Interface. The code style and idioms that are developed here will be
use throughout the rest of the book.

Chapters 6 and 7 deal with communications with servers, either through
RPC (to connect with servlets) or through direct Ajax (to communicate
with remote services).

Chapters 8 and 9 study how to add both JavaScript coding and third
party APIs to your application. Together with the previous two
chapters, everything that’s needed for mashing up services and getting
information from different sources will have been covered.

Chapters 10 and 11 deal with very common server related problems, such
as security aspects, and file upload and download.

Chapter 12 has to do with developing GWT applications that will be
used worldwide, and covers both internationalization and localization.

Finally, chapters 13 through 15 consider general themes such as
testing GWT applications, optimizing their performance, and finally
deploying them.

Hope this helps -- and just ask away if it doesn't!

Best regards,
F.Kereki



On Jun 16, 4:31 pm, Frederic Conrotte frederic.conro...@gmail.com
wrote:
 Can you summarize what kind of new information this book gives in
 comparison with previous books ?

 On 16 juin, 17:32, FKereki fker...@gmail.com wrote:

  Hi!

  I'm quite proud to be able to announce I wrote a book for Addison-
  Wesley, called ESSENTIAL GWT.

  The book is available online athttp://my.safaribooksonline.com/9780321705631
  and also (for preorders) in Amazon.com 
  athttp://www.amazon.com/Federico-Kereki/e/B003NE73LE
  or Barnes and Noble 
  athttp://search.barnesandnoble.com/Essential-GWT/Federico-Kereki/e/9780...

  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.



New book, ESSENTIAL GWT

2010-06-16 Thread FKereki
Hi!

I'm quite proud to be able to announce I wrote a book for Addison-
Wesley, called ESSENTIAL GWT.

The book is available online at http://my.safaribooksonline.com/9780321705631
and also (for preorders) in Amazon.com at 
http://www.amazon.com/Federico-Kereki/e/B003NE73LE
or Barnes and Noble at 
http://search.barnesandnoble.com/Essential-GWT/Federico-Kereki/e/9780321705143

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: click(...) is not a click?

2010-02-22 Thread FKereki
On Feb 22, 6:41 am, Thomas Broyer t.bro...@gmail.com wrote:
 On Feb 21, 5:42 pm, FKereki fker...@gmail.com wrote:

  I'm running some GWTTestCase code, and was wondering... isn't
  button.click() the same as creating a DOM click event and firing it
  for the button?

 No, it calls the button's (JavaScript/DOM) click() method.



  I'm testing a View. I added a (mock) method that set variable
  wasCalled to true; I just want to test whether the View correctly
  links the button click with the method. I set wasCalled to false, I
  fire the click event, and I check assertTrue(wasCalled).  My test code
  looks, in part, like:

  wasCalled = false;

  // doing the following works:
  final Document doc = com.google.gwt.dom.client.Document.get();
  final NativeEvent evt = doc.createClickEvent(0, 0, 0, 0, 0, false,
  false, false, false);
  DomEvent.fireNativeEvent(evt, lv.loginButton);

  // doing the following doesn't:
  // lv.loginButton.click();

  assertTrue(wasCalled);

  If I try to fire the click event with click(), nothing happens. If I
  go the DOM event way, the method fires all right.

  What am I missing here?

 click() doesn't fire an event, it just executes the default 
 action:http://www.w3.org/TR/html5/editing.html#dom-click

I'm still missing something... according to the page you cited, If
the element has a defined activation behavior, run synthetic click
activation steps on the element. Otherwise, fire a click event at the
element. In the past (i.e., with earlier versions of GWT, with
listeners instead of handlers) I'm pretty sure I wrote unit tests by
doing button.click(), and they worked...

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



Best Practices for Testing?

2010-02-21 Thread FKereki
I'm trying to work out the consensus as to the best way of structuring
a project for testing.

For client side code, you have two kinds of tests:

* pure unit tests, based on JUnit (and, thanks to MVP, applying to
most of your code)
* integration tests, based on GWTTestCase

What's the optimum project structure? Would you need new gwt.xml
files? How would you configure it?

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



click(...) is not a click?

2010-02-21 Thread FKereki
I'm running some GWTTestCase code, and was wondering... isn't
button.click() the same as creating a DOM click event and firing it
for the button?

I'm testing a View. I added a (mock) method that set variable
wasCalled to true; I just want to test whether the View correctly
links the button click with the method. I set wasCalled to false, I
fire the click event, and I check assertTrue(wasCalled).  My test code
looks, in part, like:



wasCalled = false;

// doing the following works:
final Document doc = com.google.gwt.dom.client.Document.get();
final NativeEvent evt = doc.createClickEvent(0, 0, 0, 0, 0, false,
false, false, false);
DomEvent.fireNativeEvent(evt, lv.loginButton);

// doing the following doesn't:
// lv.loginButton.click();

assertTrue(wasCalled);



If I try to fire the click event with click(), nothing happens. If I
go the DOM event way, the method fires all right.

What am I missing here?

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



GWTTestCase setup problem

2010-02-20 Thread FKereki
Hi!

My (trial, test) project named sample is configured like this:

sample
   src
  com.kereki.sample.client
 MainForm
 others...
  com.kereki.sample.server
 others...
   gwttests
  com.kereki.sample.client
 FirstTest.java

When I try to run FirstTest.java, a GWTTest, I get:

Validating newly compiled units
   [ERROR] Errors in 'file:/home/fkereki/workspace/sample/gwttests/com/
kereki/sample/client/FirstTest.java'
  [ERROR] Line 18: No source code is available for type
com.kereki.sample.client.MainForm; did you forget to inherit a
required module?

I tried adding all sources just about everywhere I could imagine, but
I cannot fix this.

What am I missing? What should I add, and where'

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.



Messages Plural Forms

2010-02-11 Thread FKereki
I'm having problems with the plural forms in the Messages interface. I
wrote

@DefaultLocale(en)
public interface MyMessages
extends Messages {

  @DefaultMessage(You got {0} things)
  @PluralText( { none, None at all,
one, A single,
two, A pair })
  String howMany(@PluralCount int count);

but then when I try

 final MyMessages myme =
GWT.create(MyMessages.class);

Window.alert(myme.howMany(0) + /
+ myme.howMany(1) + /
+ myme.howMany(2));

the result is:

You got 0 things/A single/You got 2 things

Only the one case got the message right; the others used the default
case. Am I missing something? What are the correct plural forms, if
that's my error? Where can I find them?

-- 
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: MVP with GWT 2.0/UiBinder could be simplified

2010-02-04 Thread FKereki
Hi!

Personally, I do not use the HasX methods. The way I use MVP
+UIBinder to create SomeForm is:

* SomeFormView creates its widgets through UiBinder, which are in
SomeFormView.ui.xml. SomeFormView implements SomeFormDisplay (see
below) which is the interface that SomeFormPresenter expects.

* SomeFormDisplay is an interface, that is implemented by
SomeFormView; this includes getters and setters, but doesn't provide
direct access to any widget. This interface also includes methods to
define callbacks, which are used by SomeFormView when it wants to
return data to SomeFormPresenter, or whenever an event occurs that
needs be handled by SomeFormPresenter. Events are linked to these
callbacks by using @UiHandler; the corresponding code just invokes the
appropriate callback.

* SomeFormPresenter receives a SomeFormDisplay object in its
constructor; thus, it cannot interact with the SomeFormView except
through the SomeFormDisplay interface. Just about the first thing
SomeFormPresenter does, is create appropriate callbacks, and set them
(through the SomeFormDisplay setSuchAndSuchCallback(...) methods).

Is this explanation clear? Is this closer to what you expected?

Best regards,
F.Kereki

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



GWT and Firefox 3.6

2010-01-22 Thread FKereki
Hi! Is there a way to make the GWT development mode plugin work with
Firefox 3.6? I just installed the latter, and it says the current
version of the plugin isn't supported.

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



On secure logins

2010-01-21 Thread FKereki
Hi! I was just checking the consensus on how to do a secure login and
it seems to be along the lines of:

* set a simple login application to run at https://your.own.site.com/login
* set the rest of your application to run at http://your.own.site.com/main
* if the user tries to directly go to http://your.own.site.com/main,
redirect him to https://your.own.site.com/login
* on successful login, set a cookie, and redirect to 
http://your.own.site.com/main

Is this it? Am I missing something? Any better ways to do it?
-- 
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.




On mixing https: and http:

2010-01-21 Thread FKereki
I was thinking about implementing a cart in GWT, and I am looking at
the problem of mixing http: (for browsing, selecting, etc.) and https:
(for the final part of the sale). I can see a way out by having the
application run at a http:// URL, then redirecting the application to
a https:// URL to do the actual sale, and when this is done,
redirecting the application back to a http:// URL.

Is this the best (only?) way to do it? Am I missing something?
-- 
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: Problem with AjaxLoader and AJAX Feed API

2010-01-13 Thread FKereki
I think you are forgetting to substitute $doc for document.

Good luck!
F.Kereki
-- 
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 realize paging in combination with a FlexTable

2010-01-07 Thread FKereki
I implemented paging for the Cities Browser example in my article at
http://www.ibm.com/developerworks/library/wa-aj-patterns/ --
specifically, read from Pattern: Caching onwards.

Good luck,
F.Kereki
-- 
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: Working in development mode in GWT with php

2010-01-07 Thread FKereki
I'm guessing you are running into the Same Origin Policy problem --
your application (in development mode) connects to port , but your
service is at port 8080.

Your easiest way out would be using Internet Explorer, which is more
lax regarding port changes.

Good luck!
F.Kereki
-- 
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: MVP + UiBinder, thoughts?

2009-12-29 Thread FKereki
Here goes... I'm doing a simple form that allows you to browse all
cities whose names start with a given string.

The ui.xml file contains a textbox, a couple of buttons, and a grid;
the relevant lines are:

  g:HTMLPanel
h1CitiesUpdater/h1
Start of City Name:
g:TextBox u:field=cityNameStart/
g:Button u:field=getCitiesButton text=Get Cities/
g:Button u:field=updateCitiesButton text=Update Cities/
hr /
g:FlexTable u:field=cg/
  /g:HTMLPanel

The View includes:

  @UiTemplate(CitiesUpdaterView.ui.xml)
  interface Binder extends UiBinderHTMLPanel, CitiesUpdaterView {}
  private static final Binder binder = GWT.create(Binder.class);

  @UiField   TextBox cityNameStart;
  @UiField   Button getCitiesButton;
  @UiField   Button updateCitiesButton;
  @UiField   FlexTable cg;

  SimpleCallbackObject onGetCitiesClickCallback;
  SimpleCallbackObject onUpdateCitiesClickCallback;
  SimpleCallbackObject onCityNameStartChangeCallback;

  @Override
  public void setOnCityNameStartChangeCallback(SimpleCallbackObject
acb) {
onCityNameStartChangeCallback = acb;
  }

  @Override
  public void setOnGetCitiesClickCallback(SimpleCallbackObject acb)
{
onGetCitiesClickCallback = acb;
  }

  @Override
  public void setOnUpdateCitiesClickCallback(SimpleCallbackObject
acb) {
onUpdateCitiesClickCallback = acb;
  }

  @UiHandler(cityNameStart)
  void uiOnChange(ChangeEvent event) {
onCityNameStartChangeCallback.onSuccess(null);
  }

  @UiHandler(getCitiesButton)
  void uiOnGetClick(ClickEvent event) {
onGetCitiesClickCallback.onSuccess(null);
  }

  @UiHandler(updateCitiesButton)
  void uiOnUpdateClick(ClickEvent event) {
onUpdateCitiesClickCallback.onSuccess(null);
  }

The Presenter includes:

  public CitiesUpdaterPresenter(
  final String params, final CitiesUpdaterDisplay
citiesUpdaterDisplay,
  final Environment environment) {

// ...

getDisplay().setOnGetCitiesClickCallback(new SimpleCallbackObject
() {
  // ...code to run, when the Get Cities button is clicked
});

getDisplay().setOnUpdateCitiesClickCallback(new
SimpleCallbackObject() {
 // ...code to run when the Update button is clicked
 });

getDisplay().setOnCityNameStartChangeCallback(new
SimpleCallbackObject() {
 //...code to run whenever the CityNameStart field changes
  }

So...

* the Presenter is injected with the Display (View) to use
* the Presenter injects three callbacks into the View
* the View uses @UiHandler to define three handlers
* the handlers just call the callbacks that were set by the Presenter

Note that SimpleCallback is an extension of AsyncCallback.

I hope this is clearer; I deleted as much code as possible, to make
the example simpler. Please ask again if you have any doubts or
questions.

Best regards,
F.Kereki

--

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: RequestBuilder problem

2009-12-29 Thread FKereki
That's the Same Origin Policy in action -- IE8 is more lax than
FireFox, and will allow calls to a different port in the same website.
With Firefox, if you load the program from http://www.yoursite.com:8080,
then you cannot do any RequestBuilder calls to any other URL; IE8
allows changing the port, so you can call http://www.yoursite.com:8889

On Dec 28, 8:12 am, brom38 bro...@gmail.com wrote:
 I am trying to use RequestBuilder to communicate with server using
 AJAX (GWT 2.0).
 Code is simple as possible:

 public class Main implements EntryPoint {
     public void onModuleLoad() {
         RootPanel root = RootPanel.get();
         Button button = new Button();
         button.addClickHandler(new ClickHandler() {
                         public void onClick(ClickEvent event) {
                                 SendRequest();
                         }
         });
         root.add(button);
     }

     void SendRequest()
         {
                 RequestBuilder builder = new 
 RequestBuilder(RequestBuilder.GET,
 http://127.0.01:8889/;);
                     try {
                       Request request = builder.sendRequest(null, new 
 RequestCallback
 () {
                         public void onError(Request request, Throwable 
 exception) {
                           Window.alert(OnError);
                         }

                         //@Override
                         public void onResponseReceived(Request request, 
 Response
 response) {
                           if (200 == response.getStatusCode()) {
                                   Window.alert(response.getText());
                           } else {
                       Window.alert(Response error:  +
 response.getText());
                           }
                         }
                       });
                     } catch (RequestException e) {
                       Window.alert(Exception:  + e.getMessage());
                     }
         }

 }

 Server return object in JSON Format.
 It's ok if I start GWT application in IE(8).
 But if I start app in FF(3.5.6) or Chrome(4.0.266.0) - I get strange
 behavior:
 response.getStatusCode() == 0
 response.getText() == 
 response.getStatusText() == 

--

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: MVP + UiBinder, thoughts?

2009-12-29 Thread FKereki
I also gave a thought to your method, but in the end opted out... but
I guess it's where you are heading.

In the same way that the View implements Display, an interface defined
in the Presenter class, Presenter could implement Execute, an
interface defined in the View class.

The View should have a method allowing injection of the Execute
object; the Presenter would this self injection in its constructor.

Then, whenever any event happened, the View handler would do getExecute
( ).someMethod( ).

You would do away with all anonymous classes, and each class (View,
Presenter) would implement an interface defined in the other class.

The symmetry breaks down a bit because you cannot inject each object
in the other through their constructors (obviously!)

Is this along the lines you were thinking?

--

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: MVP + UiBinder, thoughts?

2009-12-28 Thread FKereki
I use @UiHandler to define a handler that will call a callback, which
the Presenter injects into the View.

Thus, the View still fits the humble object definition, and the
Presenter is responsible for whatever gets done.

--

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.




XML parsing/building and testing

2009-12-26 Thread FKereki
Is it possible to test XML parsing and building with JUnit? Or are
those methods browser based, and cannot be tested without
GWTTestCase?

--

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: GWT slowness problem

2009-12-25 Thread FKereki
See Pattern: Thread Simulation in my Patterns + GWT + Ajax =
Usability! article at 
http://www.ibm.com/developerworks/web/library/wa-aj-patterns/index.html
-- it covers just your problem.

Best regards,
F.Kereki


On Dec 24, 9:54 pm, Tudor Andrei Raneti tudor.ran...@gmail.com
wrote:
 I am displaying 843 rows x 8 columns (one date string and 7 ints) from
 my database using a Table from Google Visualization. I get the data
 through RPC (List)
 The problem with it that it takes about 10 seconds to refresh. If i
 reorder it clicking on the columns it even freezes the browser for 10
 seconds.
 What can i do to make it faster?

--

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.




SuggestBox MVP problem

2009-12-21 Thread FKereki
Hi! Trying to work with a SuggestBox field and MVP, I found a problem.
You can getSuggestOracle(...) but you cannot set an oracle unless you
do it through its constructor, and this asymmetry poses a problem.

In MVP, the View shouldn't deal with the oracle complexity; its logic
should be a Presenter responsibility, so the View cannot create the
SuggestBox. On the other hand, since the Presenter shouldn't be
creating widgets, there's a problem... who creates the widget?

I think there should be a setSuggestOracle(...) method; thus, you
could create an oracle-less widget (possibly via UiBinder) and later
attach a Presenter-provided oracle to it.

What do you think? Am I missing anything?

--

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: gwt and seam

2009-12-21 Thread FKereki
A fellow developer, Enrique Rodriguez, recommends reading Gavin King's
book A FRAMEWORK FOR ENTERPRISE JAVA, where the GWT connection is
explained; in particular, chapter 26.

--

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: Communicating between gwt composites

2009-12-21 Thread FKereki
This sounds like you could use an Event Bus, also called Event
Collaboration pattern; see 
http://martinfowler.com/eaaDev/EventCollaboration.html
for more on it.

Basically, the idea is that whenever something interesting happens,
a Composite raises an event, which all other composites get a chance
to process. Most composites will just simply let it pass, but those
who find it relevant, can update themselves.

--

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: SuggestBox MVP problem

2009-12-21 Thread FKereki
If I understand it correctly, that poses a chicken-and-egg problem,
because the Presenter constructor requires a View, and the View
constructor would require something created by the Presenter? With
MVP, I first create a View, and then inject it into the Presenter. If
the View requires an oracle, then I must create the Presenter first --
but in that case I cannot inject the View!?

I solved this --and am not happy about it-- by (1st) creating the
View, WITHOUT the SuggestBox, (2nd) injecting the View into the
Presenter, and (3rd) having the Presenter create the oracle and
provide it to the View, so the latter can add the missing SuggestBox.
While this does work, it goes against UiBinder; the best I can do is
to reserve a space for the SuggestBox, and I cannot get to use
@UiHandler annotations.

--

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: SuggestBox MVP problem

2009-12-21 Thread FKereki
Matt Moriarity's idea suggested another possibility: using @UiField
(provided=true) and using a Factory method to actually deliver the
widget to the view. I'll give it a bit more thinking; I want to make
sure testing is still simple.

--

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.




UiBinder Composite problem?

2009-12-19 Thread FKereki
I want to include a composite object (a pair --Country and State-- of
related listboxes: whenever the user selects a country, the second
listbox is populated with that country's regions) in a UiBinder
created form.

The internal composite logic takes care of dealing with the Country
value change events. Whenever the country or the state changes, I want
to fire an event, so the UiBinder form will process it.

(Rationale: dealing with the two listboxes is an internal matter of
the composite object. The UiBinder form should not have to work with
either of the listboxes. But, the UiBinder form needs to be aware
whenever there's a change in the composite, for its own logic.)


FIRST PROBLEM:

@UiHandler(countryStateView)
void uiOnChange(ValueChangeEventObject event) {
  onCountryStateChangeCallback.onSuccess(null);
}

produces a runtime error:

23:17:56.450 [DEBUG] [mvpproject] Rebinding
com.fkereki.mvpproject.client.citiesBrowser2.CitiesBrowserView.Binde
23:17:56.456 [DEBUG] [mvpproject] Invoking
com.google.gwt.dev.javac.standardgeneratorcont...@143c05b
23:17:56.463 [ERROR] [mvpproject] Field 'countryStateView' does not
have an 'addValueChangeHandler' method associated.

How do I associate a value change event handler to the composite?


SECOND PROBLEM:

What code do I have to write in order to fire the needed event?

--

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: UiBinder Composite problem?

2009-12-19 Thread FKereki
In full validation of Murphy's Law, a few minutes after posting my
questions, everything clicked and my code works.

Now, just in case I'm doing something wrong --or at least, in a not-
too-good way-- here's what I did:

In the definition of my Country-and-State view, I added

  public class CountryStateView extends Composite implements
HasValueChangeHandlersObject

and I implemented the required method with:

  @Override
public HandlerRegistration addValueChangeHandler(
ValueChangeHandlerObject handler) {
  return addHandler(handler, ValueChangeEvent.getType());
}


Whenever the country or state listboxes changes, I do:

   ValueChangeEvent.fire(...the.composite.object..., null);

and finally, in the UiBinder created form, I wrote

  @UiHandler(countryStateView)
  void uiOnChange(ValueChangeEventObject event) {
// ...do whatever needs be done...
  }

This is working perfectly (at least to my eyes!) but I'd like to know
if it could/should be done in a better way.

--

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.




One class, several UiBinder templates

2009-12-13 Thread FKereki
Hi!

Say you want to have two templates for a single class.

You can have

@UiTemplate(firstTemplate.ui.xml)
interface Binder1 extends UiBinderHTMLPanel, yourClass {}
private static final Binder binder1= GWT.create(Binder1.class);

@UiTemplate(secondTemplate.ui.xml)
interface Binder2 extends UiBinderHTMLPanel, yourClass {}
private static final Binder binder2= GWT.create(Binder2.class);

but how do you specify to which template does each @UiField belong? If
you just write

@UiField SomeWidgetClass someWidget

UiBinder will object unless someWidget is found on BOTH templates.

Can this be done, or need I create separate classes for each template?

--

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: UiBinder and FlexTable or Grid

2009-12-10 Thread FKereki
The idea was that FlexTable and Grid hide the HTML code, and avoid
any possible cross browser problems. If you go back to using HTML
directly, you may have to deal with browser quirks on your own. Of
course, with pretty simple HTML, that won't probably be a problem, but
what I like about GWT is being able of forgetting HTML and JavaScript
-- most of the time, at least.


On Dec 10, 4:35 am, Craigo craig...@gmail.com wrote:
 I was trying to do this also.  Then I slapped myself in the head and
 realised, with the UiBinder, we can now just use plain html.

 So we can do stuff like this:
 g:HTMLPanel
     table
         trtdInfo:/tdtdg:TextBox ui:field=infoTextBox//
 td/tr
     /table
 /g:HTMLPanel

 ...there maybe a good reason you want to use a FlexTable in
 the .ui.xml file, but I can't think of it.

 On Dec 10, 1:40 pm, FKereki fker...@gmail.com wrote:

  Hi! Is it possible to include a FlexTable or Grid with UiBinder? How
  do you specify each cell? And, for FlexTables, how can you join cells
  together?

--

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.




UiBinder and FlexTable or Grid

2009-12-09 Thread FKereki
Hi! Is it possible to include a FlexTable or Grid with UiBinder? How
do you specify each cell? And, for FlexTables, how can you join cells
together?

--

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: UIBinder error, or a mistake of mine?

2009-12-08 Thread FKereki
I am running MS2 -- I'll give RC2 a try, then.

Is the -style problem fixed now?




On Dec 8, 3:58 am, Sekhar sek...@allurefx.com wrote:
 Are you running RC1? We had a similar issue in RC1, but it got fixed
 in RC2.

--

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: RC2 -- how to run?

2009-12-08 Thread FKereki
Wait a minte... I tried using the Java Application launch
because of several mails I read, but the Web Application launch does
work!?

To be kind (to my own person) I should say I outfoxed myself... and
several adjectives come to mind, all relative to relying on hearsay
and not trying things out for myself...

--

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.




UIBinder error, or a mistake of mine?

2009-12-07 Thread FKereki
In order to test UIBinder, I simply created a new uibindererror
project (which ran perfectly well) but after just adding the single
line

inherits name='com.google.gwt.uibinder.UiBinder'/

to its gwt.xml file (and touching absolutely nothing more) it never
ran again, and instead the development mode console showed:

00:01:00.605 [ERROR] Failed to load module 'uibindererror' from user
agent 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/
20091103 SUSE/3.5.5-3.1 Firefox/3.5.5' at fkereki.desktop:44111

while the application console showed:

00:01:35.252 [ERROR] Unable to find 'uibindererror.gwt.xml' on your
classpath; could be a typo, or maybe you forgot to include a classpath
entry for source?

Even removing the added line from the gwt.xml failed to make it run
again. I had to close and restart Eclipse in order to get it running
again, in its pure, original, untouched version.

What am I missing or doing wrong?

--

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: super-source used to complete java.lang.Math?

2009-12-06 Thread FKereki
Point 1 (create an issue on the GWT issue tracker) is done: see
http://code.google.com/p/google-web-toolkit/issues/detail?id=4308

I'm not sure whether locally patching Math.java (and all other
packages with missing static methods) would be a good solution; I
understand it can work for specific cases, but it seems not to good.
Of course, submitting the patch and having it accepted would be good,
but could imply long delays, which wouldn't be acceptable if you have
to solve the problem right now.

Thanks for your suggestions!

--

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.




Scrolling grids?

2009-12-06 Thread FKereki
Hi!

What's the status of PagingScrollTable (http://code.google.com/p/
google-web-toolkit-incubator/wiki/PagingScrollTable) or ScrollTable
(http://code.google.com/p/google-web-toolkit-incubator/wiki/
ScrollTable) or any similar scrollable grid?

In other words... Is any such widget planned for official inclusion in
GWT 2.0?

--

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: GWT 2.0 books

2009-12-02 Thread FKereki
Personally, I'm authoring a book on GWT 2.0 for Addison Wesley; I
expect the Rough Cut to be available on Safari Books Online early next
year.

--

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 can I share classes (code) between 2 projects

2009-11-30 Thread FKereki
Check 
http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModuleXml
and, in particular, the Dividing code into multiple modules entry.

Good luck!
F.Kereki


On Nov 30, 11:32 am, tedpottel tedpot...@gmail.com wrote:
 Hi,

 I would like to make some genrick classes that I could share between
 multple gwt projects.  Does anybody know how I would do this?

 - Ted

--

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: Compile in GWT 2.0

2009-11-29 Thread FKereki
In the Eclipse toolbar, you should have a red toolbox icon that means
GWT Compile Project.

On Nov 29, 11:18 pm, Lúcio Camilo luciocam...@gmail.com wrote:
 Is there any button in the plugin for GWT 2 like was in Hosted Mode at GWT
 1.7 to compile the code?

--

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: laizly loading panels depending on a button clicked.

2009-11-29 Thread FKereki
Couldn't a LazyPanel help you out? Check
http://googlewebtoolkit.blogspot.com/2008/11/improving-performance-with-on-demand.html
and 
http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/ui/LazyPanel.html



On Nov 29, 11:11 pm, Jacek Żebrowski yacho1...@gmail.com wrote:

 I ahve lets say - 10 panels and 10 buttons.

 I want to load diffrent one on each click - but i want to do it laizly -
 is there a way to do it other than creating 10 providers and using
 switch/case ?

 i wonder how to keep things pretty.

--

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: click event completes in hosted mode but not once deployed?

2009-11-29 Thread FKereki
NullPointerExceptions can become JavaScriptExceptions when going from
hosted (development) mode to web (production) mode.

Check out 
http://code.google.com/p/google-web-toolkit-doc-1-6/wiki/DevGuideJavaCompatibility



On Nov 29, 5:07 pm, darren minof...@gmail.com wrote:
 ok, I found my problem.

 In my client code, I had a try/catch expression that would ignore a
 NullPointerException when a Map entry was attepted that didn't exist.
 I replaced this, and my web app works as expected.

 On a similar note, does anybody have any javascript debugging tips for
 GWT? I have no way to set breakpoints / or otherwise observe the
 javascript of my app. this is making debugging with alert statements
 tedious.

 On Nov 29, 12:36 am, darren minof...@gmail.com wrote:

  Hi Everyone

  In my web application i have some links that, when clicked are
  supposed to:
  - use an RPC to get some data from the server
  - construct a new Panel
  - insert the panel into the browser document

  My solution seems to work as expected while in hosted mode, but not
  once the application is deployed.  I am using App Engine as a
  server.

  From what I can tell, the clickEvent does cause the asynchronous RPC
  to fire, and the correct results are returned to the client.  I see
  the values I expect in FireBug's header view.  For some reason the
  clickEvent is not finishing as i would expect - the new panel is not
  displayed.

  There appear to be no errors on the server, as the logs remain
  clean.

  Any help on how to debug this would be much appreciated.

  One possible problem area may be my use of java packages on the
  client? I have my code in several packages:
  com.app.client
  com.app.client.model
  com.app.client.util
  etc

  I have not made any changes to my gwt.xml file, as I'm somewhat
  confused about modules.  With no changes here, the app is working as
  expected in hosted mode, and the app does compile without error.

  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: Reading content form a website

2009-04-13 Thread FKereki

Also, when working with client-side code, keep in mind the Same
Origin Policy; you won't be able to read from a different URL.

Good luck!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---