Re: Web Application in Regional Language

2009-10-24 Thread Sundar

Tanks for your answer Mr.Tamas
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: UiBinder example, where does Spa

2009-10-24 Thread Devraj Mukherjee

At the risk of back posting, I have managed to get further with
getting a UiBinder based interface going, but get this error

01:12:52.420 [ERROR] Line 20: No source code is available for type
com.google.gwt.uibinder.client.UiBinder; did you forget to
inherit a required module?

I have checked agains the Mail app and I am importing all necessary
modules, anything obvious I could be missing?

On Sun, Oct 25, 2009 at 4:01 PM, Devraj Mukherjee  wrote:
> Hi all,
>
> First of all please bare with me as this is my first attempt at
> getting something going with GWT.
>
> I am looking at the Wiki entry for UiBinder and am trying to get the
> HelloWorld sample going
> http://code.google.com/p/google-web-toolkit/wiki/UiBinder
>
> The interface definition reads
>
> interface MyUiBinder extends UiBinder {}
>
> As I understand DivElement is the Root Element in the UI definition.
>
> Where should I import DivElement from, in my .java file?
>
> Thanks.
>
> --
> "The secret impresses no-one, the trick you use it for is everything"
> - Alfred Borden (The Prestiege)
>



-- 
"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: What is server side script selection

2009-10-24 Thread Jason Essington

Sounded to me like it does the same thing that the  
[modulename].nocache.js file does. only it does it on the server  
rather than in the client, reducing the number of connections  
required, as well as the bytes transferred.

-jason

On Oct 24, 2009, at 11:56 PM, balachandra maddina wrote:

> Hi There,
>
>I've just seen the Google Wave video in the i/o session web page  
> and one of the interesting talks in it is "Server Side Script  
> Selection". i tried finding any details available on it but got no  
> results. could any one share the details of "Server Side Script  
> Selection". probably a link or something please.
>
> your help is much appreciated.
>
> Thank you,
> bala.
>
> >


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



What is server side script selection

2009-10-24 Thread balachandra maddina
Hi There,

   I've just seen the Google Wave video in the i/o session web page and one
of the interesting talks in it is "Server Side Script Selection". i tried
finding any details available on it but got no results. could any one share
the details of "Server Side Script Selection". probably a link or something
please.

your help is much appreciated.

Thank you,
bala.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: how to have app vary numbers of radio buttons?

2009-10-24 Thread Jon

The code: works fine when commented-out rb10 is active; when
implemented as shown with array element, displays nothing:

package com.wordsbythebay.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
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.FlowPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.RadioButton;

/**
 * Entry point classes define onModuleLoad().
 */
public class GrammarFun implements EntryPoint {

/**
 * Create a remote service proxy to talk to the server-side Question
service.
 */
private final QuestionServiceAsync questionService = GWT.create
(QuestionService.class);

public RadioButton rb11 = null;
//  public RadioButton rb10 = null;
public RadioButton arbys[] = null;

/**
 * This is the entry point method.
 */
public void onModuleLoad() {
final RadioButton rb4 = new RadioButton("myGradioGroup2", 
"goes");

String[] myStringArray = {"eat", "eats"};
final Question myQuestion = new Question("the boy", 
myStringArray,
"his lunch", "s-v agreement");


// add a flow panel to the root panel
final FlowPanel panel = new FlowPanel();
//  final ScrollPanel panel = new ScrollPanel();
RootPanel.get().add(panel);


// Create a simple popup box for debugging
final DialogBox dBox = new DialogBox();
dBox.setText("would get next question from server");
dBox.setAnimationEnabled(true);
final Button cB = new Button("Close");
cB.getElement().setId("closeButton2");
VerticalPanel dVP = new VerticalPanel();
dVP.addStyleName("dialogVPanel");
dVP.add(new HTML("wadda wadda"));
dVP.add(cB);
dBox.setWidget(dVP);
// Add a handler to close the DialogBox
cB.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
dBox.hide();
}
});

// Create a handler for the radio button
class MyRadHandler implements ClickHandler {

int groupCount = 0;

/**
 * Fired when the user clicks on the radio Button.
 */
public void onClick(ClickEvent event) {
checkAnswer();
// if correct . . .
//  
getNextQuestion();
}
/**
 * check the user's answer
 */
void checkAnswer() {

questionService.getQuestion(new 
AsyncCallback() {

public void onFailure(Throwable caught) 
{
// might do better to just 
throw exception here
dBox.setText("radio button 
error getting question from server");
dBox.center();
cB.setFocus(true);
}
public void onSuccess(Question result) {

//  
if (rb10 != null && rb10.getValue() == true)
if (arbys[0] != null && 
arbys[0].getValue() == true)
panel.add(new 
HTML("[user clicked first button]"));
else if (rb11 != null && 
rb11.getValue() == true)
panel.add(new 
HTML("[user clicked second button]"));
else if (arbys[0] != null && 
rb11 != null)
   

Re: how to have app vary numbers of radio buttons?

2009-10-24 Thread Jon

Thanks Brendan,

I'm adding the radio buttons to a Vertical Panel.

Works great when I use a scalar object.

When I use an array element, I get nothing.

I take it one supported way to have varying numbers
of radio buttons is an array?

-- Jon

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



GWT + AppEngine Java training in Australia?

2009-10-24 Thread Devraj Mukherjee

Hi there,

Any aussies on this list offering training services for GWT 2.0 and
AppEngine Java programming?

If yes, please contact me off list.

Thanks.

-- 
"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)

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



UiBinder example, where does Spa

2009-10-24 Thread Devraj Mukherjee

Hi all,

First of all please bare with me as this is my first attempt at
getting something going with GWT.

I am looking at the Wiki entry for UiBinder and am trying to get the
HelloWorld sample going
http://code.google.com/p/google-web-toolkit/wiki/UiBinder

The interface definition reads

interface MyUiBinder extends UiBinder {}

As I understand DivElement is the Root Element in the UI definition.

Where should I import DivElement from, in my .java file?

Thanks.

-- 
"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)

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



EasyMock for GWT + MVP ?

2009-10-24 Thread fker...@gmail.com

I remember EasyMock didn't work for GWT, because it needed reflection,
which wasn't available for client side programming. However, I'm doing
MVP tests, so the code need not run in hosted mode, so EasyMode should
run... right? However, I'm getting the following error -- can somebody
point me in the right direction?



java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer at
org.easymock.classextension.internal.MocksClassControl.createProxyFactory
(MocksClassControl.java:78)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:
50)
at org.easymock.classextension.EasyMock.createMock(EasyMock.java:46)
at com.fkereki.mvptest.client.LoginPresenterTest.setUp
(LoginPresenterTest.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall
(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run
(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively
(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate
(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate
(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild
(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild
(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate
(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate
(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException:
net.sf.cglib.proxy.Enhancer
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
... 27 more



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Date Picker not found in GWT 1.7.1

2009-10-24 Thread Rafael DL

Hi,

Already tested in several places and none worked. Could it be any
question of location?

On 22 out, 16:59, Rafael Daniel Laurindo  wrote:
> I asked a friend to test on another pc and not work. someone can test for
> me?
>
> 2009/10/22 Isaac Truett 
>
>
>
>
>
>
>
> > Works fine for me in Chrome.
>
> > On Thu, Oct 22, 2009 at 11:58 AM, Rafael DL  wrote:
>
> > > Hi,
>
> > > I'm trying to use the datebox after GWT upgraded to version 1.7.1, and
> > > noticed that the screens that have this component does not work.
>
> > > I have tried chrome, firefox and ie8, match any of them worked.
> > > Anybody else has this problem? Does the problem is my browser or is
> > > the GWT 1.7.1? Please check the showcase, the datepicker does not
> > > work.
>
> > >http://gwt.google.com/samples/Showcase/Showcase.html#CwDatePicker
>
> > > Thanks.
>
> --
> Rafael Daniel Laurindo.
>
>  print.JPG
> 91KExibirDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Announcing GWT 2.0 Milestone 1 & UiBinder

2009-10-24 Thread Sripathi Krishnan
>
> Please, does the UI-binder thing support loading of XML-definitions at
> runtime? So you could load prepared pieces of your UI later...? on
>
NO. It does its magic at compile time. The xml files are not used post
compilation.

--Sri


2009/10/23 Jaroslav Záruba 

>
> Please, does the UI-binder thing support loading of XML-definitions at
> runtime? So you could load prepared pieces of your UI later...?
>
> On Oct 21, 8:28 pm, jscheller  wrote:
> > Is there a build of the GWT incubator library available for download
> > somewhere for use with the GWT 2.0 ms1 build?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Displaying static content on gwt client

2009-10-24 Thread Sripathi Krishnan
Instead of using java.io.* packages, you can use GWTs RequestBuilder class
to achieve the same thing. Only restriction - the static content should be
served from the same domain as your web application.


RequestBuilder request = new RequestBuilder(RequestBuilder.GET, url /*must
be in same domain as your web app*/);

try {
request.sendRequest(null, new RequestCallback() {
public void onResponseReceived(Request request, Response
response) {
String content = response.getText();
if (response.getStatusCode() != 200) {
//handle error
}
else if (content == null || content.equals("")) {
//handle error
}
else {
setStaticContentInHtmlPanel(content);
}
}
public void onError(Request request, Throwable exception) {
// handle error
}
});
}
catch (RequestException re) {
//handle error
}

--Sri


2009/10/24 usmanf 

>
> I am designing a home page for my website using GWT ext (GXT). It
> contains a lot of static contents like news, advert text etc that
> usually goes on the home page.
> Firstly I tried separating the static content into html files and
> reading them using java.io.FileReader to set them on the Panel's
> setHtml(). I realized that GWT SDK does not allow to use java.io.* on
> the client side. The only way I have now is to place the static
> content into hard-coded string values like
>
> Panel panel = new Panel();
> panel.setHtml("News news news nes newsnsnwensd nsdnewes p>");
>
> I have got a lot of static content to display on the home page which
> is quite annoying to place in the String. Is there any other way/
> solution around.
>
> thanks
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Native JSON and safe parsing implementation

2009-10-24 Thread Sripathi Krishnan
You should take a look at http://tools.ietf.org/html/rfc4627

GWT recommends using the regular expression defined in that RFC. Also, one
of their classes (ExternalTextResourcePrototype.java) defines the Regular
expression and runs eval.. so you could use the same strategy.

See method evalObject in
http://code.google.com/p/google-web-toolkit/source/browse/changes/bobv/clientbundle/user/src/com/google/gwt/resources/client/impl/ExternalTextResourcePrototype.java?spec=svn4992&r=4992


Source Code -
  /**
   * Evaluate the JSON payload. The regular expression to validate the
safety of
   * the payload is taken from RFC 4627 (D. Crockford).
   *
   * @param data the raw JSON-encapsulated string bundle
   * @return the evaluated JSON object, or null if there is an
   * error.
   */
  private static native JavaScriptObject evalObject(String data) /*-{
var safe = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
  data.replace(/"(\\.|[^"\\])*"/g, '')));

if (!safe) {
  return null;
}

return eval('(' + data + ')') || null;
  }-*/;



--Sri


2009/10/23 Brendan 

>
> I realize this post is coming at the end of the day on friday, but
> hopefully it will get a look =)
>
> Going through the different JSON parsing implementations available for
> GWT out there, almost all of them rely on a straight eval and note
> that they should only be used for trusted code. The old JSONValue code
> seems kind of quaint in light of JavaScriptObjects, and looking
> through the trunk it looks like there's just a TODO in JsonUtils for
> safe parsing.
>
> Anyway, I don't have that much experience writing JSNI code, so I
> wanted to run this small class past you all and see if this aligns
> with GWT best practices, if I'm doing anything monumentally stupid, or
> if I'm just plain missing something.
>
> The following is a pretty basic adaptation of Douglas Crockford's
> json2.js. When parse() is called, it checks to see if there is a
> native JSON defined (which exists in the latest IE, Firefox, Chrome
> and Safari) and simply uses that. If not, it defines a $wnd.JSON.parse
> in javascript using the json2 code, which is then indistinguishable
> from the native functionality in future calls (this tactic comes
> straight from json2.js).
>
> It lazily initializes the JSON object, as defining an entry point
> doesn't seem like a big win, and adds a lot of support necessary to
> make it happen. It also defines it on the $wnd object...scope still
> occasionally confuses me in javascript, but it seemed to make more
> sense to define it there than on window.
>
> Any thoughts? Even drive by comments are useful if it gives me enough
> to google. Thanks!
>
> The code:
> /**
>  * Evaluates a JSON string safely
>  *
>  * @param  The type of JavaScriptObject that should be returned
>  * @param jsonString The source JSON text
>  * @return The evaluated object
>  * @throws NullPointerException if jsonString is
> null
>  * @throws IllegalArgumentException if jsonString is
> empty
>  * @throws JavaScriptException if jsonString is non-
> parseable
>  */
> public static  final  T  parse(String
> jsonString) {
>if (jsonString == null) {
>throw new NullPointerException();
>}
>
>if (jsonString.length() == 0) {
>throw new IllegalArgumentException("empty argument");
>}
>
>// check if JSON variable is defined, if not, call init code
>if (isJsonUndefined()) {
>defineJSON();
>}
>
>return nativeParse(jsonString);
> }
>
> private static native  T nativeParse
> (String jsonString) /*-{
>return $wnd.JSON.parse(jsonString);
> }-*/;
>
> /**
>  * simple check to see if JSON object is defined
>  * will be defined in browsers with native implementation
>  * otherwise, will need to init manually
>  *
>  * @return true if JSON object is undefined
>  */
> protected static final native boolean isJsonUndefined() /*-{
>return !$wnd.JSON;
> }-*/;
>
> /**
>  * naive way to define the JSON object *if* not already
>  * natively defined by browser. straight copy from json2.js.
>  */
> private static final native void defineJSON() /*-{
>//http://www.JSON.org/json2.js
>//2009-09-29
>//Public Domain.
>//NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
>//See http://www.JSON.org/js.html
>
>// Create a JSON object only if one does not already exist.
>if (!$wnd.JSON) {
>$wnd.JSON = {};
>}
>
>(function () {
>var cx =
> /[\u\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f
> \u2028-\u202f\u2060-\u206f\ufeff\ufff0-\u]/g;
>
>// create parse method if one does not exist
>// The parse method takes a text and returns
>// a JavaScript value if the text is a valid JSON text.
>if (typeof $wnd.JSON.parse !== 'function') {
>$wnd.JSON.parse = functi

Re: how to have app vary numbers of radio buttons?

2009-10-24 Thread Brendan

Hi Jon,

Without seeing more of your code, the problem might be as simple as
the fact that you need to add the radio buttons to some container that
has been added to the window. So either Root.get().add() all your
buttons, or add them all to something like a panel and then add the
panel in the same way. If this is the problem, check out the widget
gallery radiobutton example and click on the source code tab:
http://gwt.google.com/samples/Showcase/Showcase.html#CwRadioButton

If that wasn't the problem, perhaps it's in the way you're
instantiating the radiobuttons? If you have, say, an array of their
labels you've gotten dynamically per question and a container
VerticalPanel:
String[] buttonnames = {"there", "their", "they're"};
VerticalPanel vPanel = new VerticalPanel();

The code should be as simple as
RadioButton[] arby = new RadioButton[buttonnames.length];
for(int i = 0; i < buttonnames.length; i++) {
  arby[i] = new RadioButton(groupName, buttonnames[i]);
  vPanel.add(arby[i]);
}

Then just add vPanel to the window so you can see it.
Root.get().add(vPanel);

Hope this helps and I'm not completely off base interpreting your
problem!

On Oct 23, 6:00 pm, Jon  wrote:
> Hi everyone,
>
> I'm new to GWT and developing a sample app. I want it to display
> simple questions that the user answers by clicking radio buttons. Some
> questions have two radio buttons, some have more. For example, a two
> button question:
>
>   The boy
>      o  go    o  goes
>   to the store
>
> And a three button question:
>
>   They took
>       o there   o their   o they're
>   time answering the question
>
> So, how do I use GWT to vary the number of radio buttons for each
> question?
>
> I had thought the way was to use Java arrays:
>
>         RadioButton arby[] = null;
>         arby[0] = new RadioButton(groupName, "go);
>         arby[1] = new RadioButton(groupName, "goes");
>
> But this doesn't work. Compiles but no radio buttons appear at all.
>
> What is the right way?
>
> Perhaps more generally, what is the way to create objects that refer
> to page elements whose number is known at runtime?
>
> Thanks!
>
> -- Jon
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Module CSS with relative paths then compile removes it, full path then not webapp relative at runtime

2009-10-24 Thread Open eSignForms

I have a simple login module, and I tried add  to my modules .gwt.xml file.  This seems to generate
code that assumes the login.css file is in my module's output folder,
in my case esf_login_gwt/login.css

But of course if I put the css file there, the next time I compile, it
removes everything in that module folder.  How do I get the compile to
rebuild everything and then put my login.css in there too?

Also, I tried using non-relative paths like in the .gwt.xml file, like
  and that generated code in my
HTML looking for /static/login.css, which is not correct since my WAR
is deployed using a webapp name like 'gwttest', so when deployed, it
should be looking for /gwttest/static/login.css.  It doesn't make
sense to put the '/gwtest' path in the .gwt.xml file because it
wouldn't work when deployed using other webapp names.  It seems like
I'm missing something simple here, but I'm not sure what.

I am using GWT 1.7.1 with the Eclipse plugin (latest eclipse 3.5 with
java 6).

Thanks,
David

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



Displaying static content on gwt client

2009-10-24 Thread usmanf

I am designing a home page for my website using GWT ext (GXT). It
contains a lot of static contents like news, advert text etc that
usually goes on the home page.
Firstly I tried separating the static content into html files and
reading them using java.io.FileReader to set them on the Panel's
setHtml(). I realized that GWT SDK does not allow to use java.io.* on
the client side. The only way I have now is to place the static
content into hard-coded string values like

Panel panel = new Panel();
panel.setHtml("News news news nes newsnsnwensd nsdnewes");

I have got a lot of static content to display on the home page which
is quite annoying to place in the String. Is there any other way/
solution around.

thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



MVP: get/set and callbacks

2009-10-24 Thread Eduardo Guerrero

I have been trying out the MVP idea, and these are some points (read,
doubts) I have come up with.

* I do not like the "HasValue suchAndSuchField" interface;
it's too "low level" in my opinion, and harder for testing. I have
been toying with using "String getSuchAndSuchField" and "void
setSuchAndSuchField(String s)", which I think is more "high level",
and allows mocking the view more easily.

* I also think that seting the handlers from the Presenter is also
"low level"; I'd rather have the view set its own handlers, and
communicate with the presenter by means of callbacks. The view needs
implement "void setOnClickedLogin(AsyncCallback cb)" and will use the
callback on its click button handler, or whatever. For example, you
could call the callback both on blur (whenever you exit the password
field) or on clicking the login button; the presenter needs just know
that it's time for validating the login, by using the
"getSuchAndSuchField(...)" calls.

Any opinions, kudos, flames ... ???

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



Organizing multiple HTML hosts / Entry points, etc. in single webapp

2009-10-24 Thread Open eSignForms

Newbie question for GWT 1.7 is how do people tend to organize their
webapps that may have multiple distinct sets of functionality.

That is, would people tend to create a HTML+Entry for a login page
that is streamlined only for this very specific task of authenticating
users, handling forgot passwords, etc. that are related to a non-
logged in user.

Then perhaps have another HTML+Entry for the main "dashboard" aspect
of the application.  I tend to think of this part of the application
as the run-time focus for typical users who are making use of the
system.

Then perhaps have another HTML+Entry for specialist tasks that are
more geared towards administrators or the like that are setting up the
application and all of those tasks that can be fairly complex on their
own, but aren't user functions.

And then would most people create one RPC interface to support each of
these Entry points, or might a non-trivial Entry point tend to support
a series of RPC interfaces to deal with myriad functions.

Thanks for any ideas on what are considered best practices in this
area.

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



CKEditor integration experiences with GWT 1.7?

2009-10-24 Thread Open eSignForms

Has anybody run into any issues integrating CKEditor with GWT 1.7?
While the RichEditor is okay, we need the added power of tables and
rendering with user-defined CSS for our needs where users are building
HTML "chunks" and need the additional layout and rending control.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Add widget recursively

2009-10-24 Thread Dave

I think this should be quite simple. Without writing a ton of code
that would already be in the StockWatcher example:

1. Create the popup panel with the layout you currently have.
2. Instead of the listbox, put a VerticalPanel in its place.
3. Create the first listbox and add it to the VerticalPanel.
4. On the label, add an onClick() handler:
4a. Each time the handler is clicked, create a new listbox with
whatever properties you want
4b. Add the new listbox to the VerticalPanel.

The VerticalPanel will allow it to keep adding listboxes, and should
shove the buttons down below the last row in the panel.

If you need reference to all the listboxes, just create an
ArrayList which contains each newly created listbox.

Hope that helps. If you need code, I'm sure someone can oblige, but
all of this is very basic stuff that the StockWatcher tutorial covers.

Dave


On Oct 23, 4:06 am, MarcoGT  wrote:
> Hi all,
>
> I have got a popup panel that looks like this:
>
> listbox1 - label
> button1 button2
>
> I would like that when label is clicked, a listbox identical to
> listbox1 appears before two buttons...how to do?
> Obviously, if I clicked three times on label, three listboxes have to
> appears...
>
> I am stuck.
>
> Thanks,
> Marco

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



GWT and Eclipse Plugin: Compilation failed

2009-10-24 Thread shooty

Hi,

I installed Eclipse and GWT-Plugin several times. When I try to
compile the Package, i ALWAYS get an popup with an error message.
nevertheless the code is running on localemulation and local
internetexplorer.

 I have no clue how to solve this. I tried everything. I reduced the
sourcecode to nothing, even did not use the standard wizzard example.
it is still the same error.

the problem is also that i can not upload to google app engine. guess
it is interupted by the popup?

please help!


shooty


Console looks good:

Compiling module com.test.test
   Compiling 1 permutations
  Permutation compile succeeded
   Linking into D:\workspace\test\war
  Link succeeded
   Compilation succeeded -- 4,266s


But Pop-Up oocurs...

eclipse.buildId=M20090917-0800
java.version=1.6.0_13
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product
org.eclipse.epp.package.java.product


Error
Sat Oct 24 03:18:14 CEST 2009
GWT compilation failed

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



how to have app vary numbers of radio buttons?

2009-10-24 Thread Jon

Hi everyone,

I'm new to GWT and developing a sample app. I want it to display
simple questions that the user answers by clicking radio buttons. Some
questions have two radio buttons, some have more. For example, a two
button question:

  The boy
 o  goo  goes
  to the store

And a three button question:

  They took
  o there   o their   o they're
  time answering the question

So, how do I use GWT to vary the number of radio buttons for each
question?

I had thought the way was to use Java arrays:

RadioButton arby[] = null;
arby[0] = new RadioButton(groupName, "go);
arby[1] = new RadioButton(groupName, "goes");

But this doesn't work. Compiles but no radio buttons appear at all.

What is the right way?

Perhaps more generally, what is the way to create objects that refer
to page elements whose number is known at runtime?

Thanks!

-- Jon

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



Native JSON and safe parsing implementation

2009-10-24 Thread Brendan

I realize this post is coming at the end of the day on friday, but
hopefully it will get a look =)

Going through the different JSON parsing implementations available for
GWT out there, almost all of them rely on a straight eval and note
that they should only be used for trusted code. The old JSONValue code
seems kind of quaint in light of JavaScriptObjects, and looking
through the trunk it looks like there's just a TODO in JsonUtils for
safe parsing.

Anyway, I don't have that much experience writing JSNI code, so I
wanted to run this small class past you all and see if this aligns
with GWT best practices, if I'm doing anything monumentally stupid, or
if I'm just plain missing something.

The following is a pretty basic adaptation of Douglas Crockford's
json2.js. When parse() is called, it checks to see if there is a
native JSON defined (which exists in the latest IE, Firefox, Chrome
and Safari) and simply uses that. If not, it defines a $wnd.JSON.parse
in javascript using the json2 code, which is then indistinguishable
from the native functionality in future calls (this tactic comes
straight from json2.js).

It lazily initializes the JSON object, as defining an entry point
doesn't seem like a big win, and adds a lot of support necessary to
make it happen. It also defines it on the $wnd object...scope still
occasionally confuses me in javascript, but it seemed to make more
sense to define it there than on window.

Any thoughts? Even drive by comments are useful if it gives me enough
to google. Thanks!

The code:
/**
 * Evaluates a JSON string safely
 *
 * @param  The type of JavaScriptObject that should be returned
 * @param jsonString The source JSON text
 * @return The evaluated object
 * @throws NullPointerException if jsonString is
null
 * @throws IllegalArgumentException if jsonString is
empty
 * @throws JavaScriptException if jsonString is non-
parseable
 */
public static  final  T  parse(String
jsonString) {
if (jsonString == null) {
throw new NullPointerException();
}

if (jsonString.length() == 0) {
throw new IllegalArgumentException("empty argument");
}

// check if JSON variable is defined, if not, call init code
if (isJsonUndefined()) {
defineJSON();
}

return nativeParse(jsonString);
}

private static native  T nativeParse
(String jsonString) /*-{
return $wnd.JSON.parse(jsonString);
}-*/;

/**
 * simple check to see if JSON object is defined
 * will be defined in browsers with native implementation
 * otherwise, will need to init manually
 *
 * @return true if JSON object is undefined
 */
protected static final native boolean isJsonUndefined() /*-{
return !$wnd.JSON;
}-*/;

/**
 * naive way to define the JSON object *if* not already
 * natively defined by browser. straight copy from json2.js.
 */
private static final native void defineJSON() /*-{
//http://www.JSON.org/json2.js
//2009-09-29
//Public Domain.
//NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
//See http://www.JSON.org/js.html

// Create a JSON object only if one does not already exist.
if (!$wnd.JSON) {
$wnd.JSON = {};
}

(function () {
var cx = 
/[\u\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f
\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\u]/g;

// create parse method if one does not exist
// The parse method takes a text and returns
// a JavaScript value if the text is a valid JSON text.
if (typeof $wnd.JSON.parse !== 'function') {
$wnd.JSON.parse = function (text) {

var j;

// first stage, escape sequences
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('' + 
a.charCodeAt(0).toString(16)).slice(-4);
});
}

// second stage, remove non-JSON patterns
if (/^[\],:{}\s]*$/.

test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').

replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?
\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// third stage, eval
j = eval('(' + text + ')');

return j;

}

// If the text is not JSON parseable, then a 
SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());

}-*/;

--~--~-

GWT ListBox Behavior

2009-10-24 Thread oks

I create a listbox with item 1, 11, 2, 22, and 3.

I press 1, then the item with value 1 is selected.

After 1 second, I press 2, then the item with value 2 is selected.

If I press 2 immediately right after pressing 1, the item with value 2
is not selected.

If I press 1 again immediately right after pressing 1, the item with
value 11 is selected.


Is this the right behavior? If yes, how can I get 2 when pressing 2
immediately right after pressing 1?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Hibernate4GTW + GWT 1.7 - problems?

2009-10-24 Thread Jason Essington

try Gilead, I believe that is the new name of that project.

-jason
On Oct 23, 2009, at 2:36 PM, rernst wrote:

>
> Hi,
>
> does Hibernate4GWT support GWT 1.7? I only saw mention up to 1.5.
> >


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



Data aware drop down widgets with MVP ?

2009-10-24 Thread fker...@gmail.com

Hi! Thinking about MVP... how would you implement a data aware drop
down widget?

Say you want to let the user enter a country code in the View. You
could use a TextBox, but a drop down list would be more usable. How
would the widget get its values? Should the Presenter know about the
widget type, contact the server, get the countries data, and then
"feed" the widget? Doesn't that somehow violate the rule that you
should be able to change the view without having to change the
Presenter?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



com.google.gwt.core.Core Module

2009-10-24 Thread Paulo Cordeiro

Hello,

I put the



in my project becouse of JClassType and JParameterizedType classes,
but the compiler
not recognizes.

Any idea?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: how do I specify String[] in properties file when using i18nCreator?

2009-10-24 Thread Grary

Thanks - have found that approach inconvenient.

I guess using maps instead of arrays in .properties file is an
alternative.

Grar

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



A strange setting for MVP

2009-10-24 Thread fker...@gmail.com

I have been studying http://blog.appenginefan.com/search/label/Schluesselmeister
application, and that got me to thinking about MVP... In that example,
"Display" is about the same as "View", and "Controller" is like
"Presenter". You inject the View to the Presenter through its
constructor... but then the Presenter injects itself into the View by
doing something like View.setPresenter(this);

There are benefits, but having the View know about the Presenter seems
odd.

You could have:
LoginPresenter.View interface:
String getName( );
String getPass( );
void setPresenter(Presenter p);

LoginView.Presenter interface:
tryToLogin( )

LoginPresenter implements LoginView.Presenter with something like:
// call a remote service with myView.getName( ) and myView.getPass
( )
// on callback, if the service agrees, initialize everything, show
the menu, etc.

LoginView implements LoginPresenter.View with something like:
// add a click handler to its "login" button
// which will call presenter.tryToLogin( )

The LoginPresenter constructor looks like
LoginPresenter(LoginView view ...and some other parameters...)
myView = view;
myView.setPresenter(this);
...

This way of implementing things doesn't require sending events from
the view to the presenter, or the presenter providing callbacks to the
view... but somehow looks weird to me... any thoughts on 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-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Insert addthis-button in GWT

2009-10-24 Thread Bryan

Add the  separately:

Document doc = Document.get();
ScriptElement script = doc.createScriptElement();
script.setSrc("http://...";);
doc.getBody().appendChild(script);

Then you can add the rest of the HTML and it should work.

b

On Oct 24, 1:32 pm, vokke  wrote:
> Hello newsgroup.
> I want to insert an addthis-button to my GWT-Project.
> When I try to insert the html-code into an HTML-Widget or HTMLPanel-
> Widget, the button shows up,
> but does not work properly.
> It als works when I put it inside the -tags on the base html
> page.
> What do I do wrong?
>
> Here's the addthis-button code:
> 
> 
> http://www.addthis.com/bookmark.php?
> v=250&pub=xa-4ae3631c6412b94f">http://s7.addthis.com/
> static/btn/v2/lg-bookmark-en.gif" width="125" height="16"
> alt="Bookmark and Share" style="border:0"/>