Re: How to do cross site implementation in GWT

2008-11-28 Thread Manish Kumar

Hi,

There is a bit change in approach. Somehow i am now able to connect to GWT 
from my external HTML/website.
The way I have done is on click of a button in my html , I open a new window 
which loads the GWT Host HTML which in turns calls a JSNI method.
The problem is now to pass some parameter from my website/HTML to GWT native 
method.

Please help me out to get some way.

Thanking you for much needed help  co-operation.

Regards
Manish

- Original Message - 
From: Manuel [EMAIL PROTECTED]
To: Google-Web-Toolkit@googlegroups.com; [EMAIL PROTECTED]
Sent: Thursday, November 27, 2008 1:26 AM
Subject: Re: How to do cross site implementation in GWT



 One thing I just noticed in your code is that you are  exporting java
 methods to javascript. When I tryied that a few weeks ago I could not
 figure out how the instance expression part worked, so I only have
 tried this with static methods
 e.g.

 public static int displayDialog(String companyId, String companyName) {
 ResponseDialog.getInstance().doSplash(companyId, companyName);
 return 0;
 }
 public static native void exportJavaMethod() /*-{
 $wnd.sendEmail =
 @com.fbg.client.Emailer::displayDialog(Ljava/lang/String;Ljava/lang/String;);
 }-*/;
 and then calling the function from any javascript code in the host as
 sendEmail(id, name)

 Perhaps you can try changing PMGWTHtmlUtils::invokeGWT to be a static 
 function


 On Wed, Nov 26, 2008 at 11:32 AM, Manuel [EMAIL PROTECTED] wrote:
 I pretty much followed the steps detailed in

 http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=FAQ_JSONFeedsFromOtherDomain

 Plus I am passing parameters via javascript variables in the host
 page. The code in the host page looks like:

 script type=text/javascript
var fbg_customerId = '238976';
var fbg_type = 'vertical';
 /script
 script type=text/javascript language=javascript
 src=http://www.gov-world.com/gwt/com.fbg.headlinesreader.HeadlinesReader.nocache.js;/script
 div id=fbgPressReleases
 /div

 in the onModuleLoad() function I call the following native function to
 read the javascript variables

public native void getParameters() /*-{
 
 [EMAIL PROTECTED]::parameter_id =
 $wnd.fbg_customerId;
 
 [EMAIL PROTECTED]::parameter_format
 = $wnd.fbg_type;
 }-*/;

 and after that I call the makeJSONRequest() function which is declared
 as follows:


public static native void makeJSONRequest(String url, JSONHandler 
 handler) /*-{
$wnd.jsonCallback = function(jsonObj) {
 
 @com.fbg.headlinesreader.client.HeadlinesReader::dispatchJSON(Lcom/google/gwt/core/client/JavaScriptObject;Lcom/fbg/headlinesreader/client/JSONHandler;)(jsonObj,
 handler);
}

// create SCRIPT tag, and set SRC attribute equal to JSON 
 feed URL +
 callback function name
var script = $wnd.document.createElement(script);
script.setAttribute(src, url+jsonCallback);
script.setAttribute(type, text/javascript);
 
 $wnd.document.getElementsByTagName(head)[0].appendChild(script);

}-*/;

public static void dispatchJSON(JavaScriptObject jsonObj, 
 JSONHandler
 handler) {
handler.handleJSON(jsonObj);
}

public void handleJSON(JavaScriptObject obj)  {
// String s;
if (obj == null) {
// grr
return;
}

JSONArray myarr;
JSONObject myObj;
myarr = new JSONArray(obj);
for (int i=0; imyarr.size();i++) {
myObj = myarr.get(i).isObject();
headlines.add(  new Headline(
 
 myObj.get(title).isString().stringValue().trim(),
 
 myObj.get(link).isString().stringValue().trim(),
 
 myObj.get(create_date).isString().stringValue().trim()
) );
}
showNews();  //and this finally adds widgets to the 
 element
 fbgPressReleases in the host page
}



 I read that there was an inssue with firefox 3 and IE7 that made
 difficult to access the window object of a webpage from a script
 loaded from a different domain, so my Assumption is that the
 add-linker name=xs / in the configuration signals GWT to work
 around this issue




 On Tue, Nov 25, 2008 at 8:36 PM, Manish Kumar [EMAIL PROTECTED] 
 wrote:

 Hi Manuel,

 Thanx for response.But I wanna know how do you passing the parameter 
 from
 our website/HTML to gwt component.
 is this by using JSNI.if yes , how do attached your compiled gwt app 
 source
 to your website/html.This point is crucial for me
 since i am not able to connect to gwt from our html in deployment 
 mode( not
 hosted mode ).

 please provide the detail about your approach.

 Regards
 Manish

 - Original Message -
 From: Manuel Aguilera [EMAIL PROTECTED]
 To: Google Web Toolkit Google-Web-Toolkit@googlegroups.com
 

Re: Load images and css from different folder according to locale and company change

2008-11-28 Thread eskatos

You could use the Dictionnary gwt class to inject variables from your host 
page to your gwt app.

Paul


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



How to run signed applet in hosted mode and other inside

2008-11-28 Thread avd

hello sir,
I have two problem in gwt:
1..How to run signed applet in hosted mode.i put all class files of
applets in public folder and change the html file that exist in public
folder by putting these lines applet code=class name name=applet
name archive=jar file name /applet and i also make a javascript
file in that i wrote a function that function called the java function
that lives in applet class files,when i run applet through html file
by simple clicking in www folder then it works fine but when i run
through hosted mode it gives error:cannot load class sun/plugin/
JavaRunTime.the bridge was installed at c:\PROGRA~1\JAVA\JRE1.6.0
but the class is not there modify the registry key to reflect the new
bridge location.something like this...
   how can i resolved this problem??


2..Actually my project has some programs that stored images three
folders named redim, scaled, and temp that stroed the images after
features calculation,when i run it in hosted mode it works fine but
when i create a war file through eclipse and deploy it at tomcat in
webapps,then i find that in project folder there is no such folder i.e
redin, scaled and temp and my program does not work properly.
 so please suggest me where i make these three folder in webapps.



please give me solution i am highly thankful to you...



with regards
avdhesh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Why it's so slow?

2008-11-28 Thread Andrey



On Nov 27, 6:03 pm, Andrey [EMAIL PROTECTED] wrote:

 1) Debug mode does not work in NetBeans since: [ERROR] Out of
 memory; to increase the amount of memory, use the -Xmx flag at startup
 (java -Xmx128M ...)

Ok, this can be solved by patching the line in /nbproject/build-
gwt.xml (by adding -Xmx128M)
...
property name=gwtshell.jvmargs.base value=-Xdebug -
Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=$
{jpda.address.gwt} -Xmx128M/
...

Regards,
  -Andrey
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Simple app for DB view (?)

2008-11-28 Thread Andrey

On Nov 27, 2:53 am, Geraldo Lopes [EMAIL PROTECTED] wrote:
 The gwt-incubator has PagingScrollTable widget that provides
 pagination. if you want to try you can 
 followhttp://code.google.com/p/google-web-toolkit-incubator/wiki/MakingIncu...
 and get the latest version of the project. There are a example, how
 use the widget.

 Basically you need...

Thank You.

I tried to follow You code and comments as much as possible.

But for now my code does not work now :(.

Here is it:


gwt.properties

# The name of the module to compile
gwt.module=unipac.Main
# Path of the GWT installation directory.Use Internet-Standard of
forward slases for this path
gwt.install.dir=D:/Andrey/downloads/java/gwt-windows-1.5.3
# Folder within the web app context path where the output
# of the GWT module compilation will be stored.
gwt.output.dir=/unipac.client
# Script output style: OBF[USCATED], PRETTY, or DETAILED
gwt.compiler.output.style=OBF
# The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG,
gwt.compiler.logLevel=WARN
# Script output style: OBF[USCATED], PRETTY, or DETAILED
gwt.shell.output.style=OBF
# The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG,
gwt.shell.logLevel=WARN


persistence.xml

?xml version=1.0 encoding=UTF-8?
persistence version=1.0 xmlns=http://java.sun.com/xml/ns/
persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd;
  persistence-unit name=test transaction-type=RESOURCE_LOCAL
providerorg.hibernate.ejb.HibernatePersistence/provider
exclude-unlisted-classesfalse/exclude-unlisted-classes
properties
  property name=hibernate.connection.username
value=banalyse01/
  property name=hibernate.connection.driver_class
value=oracle.jdbc.OracleDriver/
  property name=hibernate.connection.password
value=banalyse01/
  property name=hibernate.connection.url
value=jdbc:oracle:thin:banalyse01/[EMAIL PROTECTED]:1521:PROD01/
  property name=hibernate.cache.provider_class
value=org.hibernate.cache.NoCacheProvider/
/properties
  /persistence-unit
/persistence



web.xml

?xml version=1.0 encoding=UTF-8?
web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
servlet
servlet-nameServiso/servlet-name
servlet-classunipac.server.ServisoImpl/servlet-class
/servlet
servlet-mapping
servlet-nameServiso/servlet-name
url-pattern/serviso/url-pattern
/servlet-mapping
session-config
session-timeout
30
/session-timeout
/session-config
welcome-file-list
welcome-filewelcomeGWT.html/welcome-file
/welcome-file-list
/web-app



Main.gwt

?xml version=1.0 encoding=UTF-8?
module
inherits name=com.google.gwt.user.User/

  inherits name='com.google.gwt.widgetideas.WidgetIdeas'/
  inherits name='com.google.gwt.widgetideas.ScrollTable'/


!-- Specify the app entry point class.   --
entry-point class=unipac.client.MainEntryPoint/


!-- Additional source path --
source path='domain'/
source path='client'/

  servlet path=/servico class=unipac.server.servisoImpl/

/module


package unipac.client;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.widgetideas.table.client.TableModel;
import com.google.gwt.widgetideas.table.client.TableModel.Request;
import
com.google.gwt.widgetideas.table.client.TableModel.SerializableResponse;
import unipac.domain.Cliente;

public class ClienteTableModel extends TableModelCliente {

public ClienteTableModel()
{

}

  @Override
public void requestRows(
final Request request,
final CallbackCliente callback)
{


Re: setting Label widgets in each cell of 1000row x 17col grid is too slow..

2008-11-28 Thread Thomas Broyer


On 26 nov, 19:41, Jim Colton [EMAIL PROTECTED] wrote:
 ..taking about 25 seconds on a 1.7ghz laptop with firefox.

 It that length of time expected or may there be something wrong with two
 nested loops for row, col and setWidget on the grid?

I would first try a BulkTableRenderer; if you can't (I can't see any
reason why, but...) then use an IncrementalCommand.

Can't you also use setText instead of setLabel? If you can avoid
instanciate 17000 Label objects, it'll probably run faster too ;-)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: StatusCodeException.getStatusCode() == 0

2008-11-28 Thread Thomas Broyer



On 28 nov, 00:23, Edwin Nathaniel [EMAIL PROTECTED] wrote:
 I'm currently getting statusCode == 0 if I kill hosted-mode but run
 the client on a browser. Any reason why? I thought the RPC should
 failed and return statusCode 5xx cause the server is unreachable?

A status code is part of the server response, so if the server is
unreachable you won't have any response, hance any status code.
Moreover, 5xx is defined to mean server error, so once again, if the
server is unreachable, it cannot be a server error.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



SecureRemoteService and Servlet. The battle against XSRF.

2008-11-28 Thread Patrick Ratelband

Hey everyone,

I have been working a while now on properly defending my GWT app
against Cross Site Request Forgery (XRSF) with a minimal change in the
code of the application itself.

My idea has been to create a new RPC call that will be the same from
the programmers points of view as the normal, but which will add some
value (a sessionID for instance) to the list of supplied parameters
just before the call is send. Then, on the server side, the programmer
would extend the SecureRemoteServiceSevlet (SRSS) instead of the
normal one. This secure version will simply remove the extra
paramater, check it's validity and only execute the requested method
if the authentication succeeds.

So far I have been able to subclass the RemoteServiceServlet (RSS)
into the SRSS. It overrides the processCall(String payload) method to
implement the verification (in my case the last argument, but that can
easily be changed), thus working exactly the same as the normal RSS
without any change needed in the code other than changing the extend.

The problem is that I really do not understand where I might add the
code to modify the sending of the request client side. I have studied
the RPC diagrams and almost everything I could find on the group
concerning RPC, but I still do not understand what I need to change or
override to create a custom RPC call. I have thought about making a
subclass of the ServiceDefTarget so that the calling URL could be
modified, but this is an interface and not a class, so is not going to
work.

Does anyone have any idea's on this?

Patrick

PS: If I succeed at making something useful, I will create a package
and a tutorial to share my knowledge. No need to reinvent the wheel.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Support for X.509 certificates

2008-11-28 Thread Lonifasiko

Maybe I'm asking a stupid question, but support for X.509 certificates
concerns to GWT or to the application server I'm using, JBoss in my
case?

Thanks and regards.

--
Miguel
Blog: http://lonifasiko.blogspot.com
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Load images and css from different folder according to locale and company change

2008-11-28 Thread zujee

Ooh..great.. this is the first time i heard about dictionary class..
I  will try that..
Can you elaborate in which way i need to move for useing dictionary
class..
Is there any example available.
thanks and regards
Zujee

On Nov 28, 2:15 pm, eskatos [EMAIL PROTECTED] wrote:
 You could use the Dictionnary gwt class to inject variables from your host
 page to your gwt app.

 Paul
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: make my site visible to others

2008-11-28 Thread Patrick Ratelband

What do you mean with this question? It is a web page, this means that
if you put it somewhere where other people can download it, they can
see it.

If you do not use fancy client-server connection things but only work
client side, a free website hoster should do the trick.

Look on your fav search engine to find a free webhoster and see their
manual on how to upload files.

Patrick

On Nov 27, 11:41 pm, mskart [EMAIL PROTECTED] wrote:
 Hello everyone!

 Can anyone answer my question:

 How can i make the web page that i created with GWT visible to
 others???

 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: SecureRemoteService and Servlet. The battle against XSRF.

2008-11-28 Thread gregor

Hi Patrick,

You could add parameters to the URL from an inner class inside the
RemoteService interface e.g.

public interface MyService extends RemoteService {

MyReturnValue aMethod();

/**
 * Utility/Convinience class.
 * Use MyService .App.getInstance() to access static instance of
IpsvRmapServiceAsync
 */
public static class App {
private static MyServiceAsync ourInstance = null;
public static synchronized MyServiceAsync getInstance() {
if (ourInstance == null) {
ourInstance = (MyServiceAsync ) GWT.create
(MyService.class);
// alter the URL here
   ((ServiceDefTarget) ourInstance).setServiceEntryPoint
(GWT.getModuleBaseURL() + MyService);
}
return ourInstance;
}
}

However that is probably not such a good idea 'cos the session ID
would be visible on the wire.

A second ideas is to use a variation of the Command pattern which
might better be called Payload since it doesn't execute() anything
itself on arrival. Something like

public abstract class Payload implements Serializable {

   private String sessionID;

  public Payload() {
sessionID = someSessionIDCookieGrabbingMethod();
  }
   // or alternatively
   public Payload(String sessionID) {
   this.sessionID = sessionID;
  }

  public String getSessionID {
  return sessionID;
  }
}

Then if you then extend this to make individual RPC service parameters
(a sort of bucket for the objects you need to pass over for each
service call (although sometimes they are reusable for several calls)
you can cast them all to Payload in your override processCall and
examine and validate the sessionID before processing the call.

regards
gregor

On Nov 28, 11:52 am, Patrick Ratelband [EMAIL PROTECTED] wrote:
 Hey everyone,

 I have been working a while now on properly defending my GWT app
 against Cross Site Request Forgery (XRSF) with a minimal change in the
 code of the application itself.

 My idea has been to create a new RPC call that will be the same from
 the programmers points of view as the normal, but which will add some
 value (a sessionID for instance) to the list of supplied parameters
 just before the call is send. Then, on the server side, the programmer
 would extend the SecureRemoteServiceSevlet (SRSS) instead of the
 normal one. This secure version will simply remove the extra
 paramater, check it's validity and only execute the requested method
 if the authentication succeeds.

 So far I have been able to subclass the RemoteServiceServlet (RSS)
 into the SRSS. It overrides the processCall(String payload) method to
 implement the verification (in my case the last argument, but that can
 easily be changed), thus working exactly the same as the normal RSS
 without any change needed in the code other than changing the extend.

 The problem is that I really do not understand where I might add the
 code to modify the sending of the request client side. I have studied
 the RPC diagrams and almost everything I could find on the group
 concerning RPC, but I still do not understand what I need to change or
 override to create a custom RPC call. I have thought about making a
 subclass of the ServiceDefTarget so that the calling URL could be
 modified, but this is an interface and not a class, so is not going to
 work.

 Does anyone have any idea's on this?

 Patrick

 PS: If I succeed at making something useful, I will create a package
 and a tutorial to share my knowledge. No need to reinvent the wheel.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Who can read chinese?

2008-11-28 Thread Adam T

http://translate.google.com/translate_t#

Above link might help
//A

On 28 Nov, 05:16, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 I need help ,  i hava some API of YI language  , but all words is
 china words ,  who can help me?ASAP , 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Image - setting image via css

2008-11-28 Thread Michel

Hello there.

When we use the Image class, we can set the image via the setUrl
command.

Fine.

But now I wanted to set the image which is defined in a css class

Is it possible to use Image for this?

Thanks a lot.

Regards,
Michel.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Please help me to solve out this prob...

2008-11-28 Thread Bhupen
solved but in other way... thanks for help it's really feel good
if i get so many response ... thanks guys...

On Nov 28, 2:44 am, gregor [EMAIL PROTECTED] wrote:
 Hi Bhupen,

 This looks suspiciously like it might be the cause of your exception.

  to load another page i m using code like below...

                  RootPanel.get(irisPage).clear();
                  
  RootPanel.get(irisPage).add(createUserPageContent.loadPage());
                  agentListWidget.widgetInterface();

 Suppose you did it something like this (SimplePanel can only have one
 widget):

     SimplePanel pageContainer = new SimplePanel();
     // add whatever the first page widget is to pageContainer
     RootPanel.get(irisPage).add(PageContainer);

 Then to swap out:

     Widget currPage = pageContainer.getWidget();
     pageContainer.remove(currWidget);
     pageContainer.add(createUserPageContent.loadPage());

 That way you get the framework sort out the housekeeping for attaching
 and detaching widgets from the DOM.

 regards
 gregor

  On Nov 27, 12:12 pm, Bhupen [EMAIL PROTECTED] wrote:

   topLayout.printTop();
   RootPanel.get(Top-Menu).add(topMenu.mainMenu());
   RootPanel.get(irisPage).add(agentListPageContent.loadPage());

   // top Layout
   package com.client;

   import com.google.gwt.user.client.ui.HTML;
   import com.google.gwt.user.client.ui.RootPanel;
   import com.google.gwt.user.client.ui.ClickListener;
   import com.google.gwt.user.client.Window;
   import com.google.gwt.user.client.ui.Widget;
   import com.google.gwt.user.client.ui.Image;

   public class topLayout
   {

           public static void printTop()
           {
                   HTML topContent = new HTML(table width='1004' border='0'
   cellspacing='0' cellpadding='0'
                     + tr
                     + td
                     +   table width='1004' border='0' cellspacing='0'
   cellpadding='0'
                     +   tr 
   style='background-image:url(images/headerbg.gif); height:
   72px;'
                     +   td  width='29' height='72'/td
                     +   td width='634'img src='images/logo.gif' 
   width='242'
   height='72' //td
                     +   td width='336'img src='images/airtelindia.gif' 
   width='230'
   height='72' //td
                     +   /tr
                     +   tr
                     +   td  width='29' height='37' img 
   src='images/menuleftbg.gif'
   width='29' height='37' //td
                     +   tddiv style='width:759px; 
   background-image:url(images/
   menubg.gif); height:37px;'
                     +        table width='758' border='0' cellspacing='0'
   cellpadding='0' style='font-family:Arial, Helvetica, sans-serif; font-
   size:18px; margin-top:8px; color:#FF;' 

                    + tr
                           + td width=\100%\ class='menu-text' 
   align='center' id='Top-
   Menu' /td
                     + /tr
                     +                     /table

                     +             /div/td
                     +             tdimg src='images/menurightbg.gif' 
   width='230' height='37' //td

                     + /tr
                     +/table
                     +/td
                     +/tr
                     +/table);
                     RootPanel.get(TopContents).add(topContent);
           }

   }

   //topMenu

   package com.client;

   import com.google.gwt.user.client.ui.HTML;
   import com.google.gwt.user.client.ui.RootPanel;
   import com.google.gwt.user.client.ui.ClickListener;
   import com.google.gwt.user.client.Window;
   import com.google.gwt.user.client.ui.MenuBar;
   import com.google.gwt.user.client.ui.MenuItem;
   import com.google.gwt.user.client.Command;
   import com.google.gwt.user.client.ui.Widget;
   import com.google.gwt.user.client.ui.Composite;
   import com.google.gwt.user.client.ui.Label;
   import com.google.gwt.user.client.ui.TabPanel;
   import com.google.gwt.user.client.ui.Panel;

   public class topMenu extends Composite{

   public static Widget mainMenu()
           {
                   Command menuClick = new Command()
                           {
                                   public void execute()
                                   {
                                                   dashBoardPage.dashBoard();
                                   }

                           };

                           Command menuClick1 = new Command()
                           {
                                   public void execute()
                                   {
                                                   
   createUserPage.createUser();
                                   }

                           };
                           Command menuClick2 = new Command()
                           {
                                   public void execute()
                                   {
                                                   userListPage.createUser();
                      

How to test server-side code?

2008-11-28 Thread Andrey

Hello,

Is there any documentation about how to test server-side code under
tomcat?


I have code like this:
...
public class ServicoImpl extends RemoteServiceServlet implements
Servico {

public SerializableResponseCliente requestRows(Request request,
Cliente qbe) {

SerializableResponse result = null;
EntityManager entityManager = CommonEntityManager.getEm();

entityManager.getTransaction().begin();

Query q = entityManager.createQuery(from Cliente c);
q.setMaxResults(request.getNumRows());
q.setFirstResult(request.getStartRow());

entityManager.getTransaction().commit();

result = new SerializableResponseCliente(q.getResultList());
System.out.println(I'm here);
return result;
}
...

which give nothing (or gives something that I cannot see, including
log I'm here...) to this client code:
...
public void requestRows(
final Request request,
final CallbackCliente callback)
{

Servico.Util.getInstance().requestRows(request, null,
new AsyncCallbackSerializableResponseCliente() {

public void onFailure(Throwable caught)
{
callback.onFailure(new Exception(falha
rpc));
}

public void onSuccess
(SerializableResponseCliente result)
{
callback.onRowsReady(request, result);
}
});
}
...

Regards,

-Andrey
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Support for X.509 certificates

2008-11-28 Thread olivier nouguier

Application server

On Fri, Nov 28, 2008 at 1:16 PM, Lonifasiko [EMAIL PROTECTED] wrote:

 Maybe I'm asking a stupid question, but support for X.509 certificates
 concerns to GWT or to the application server I'm using, JBoss in my
 case?

 Thanks and regards.

 --
 Miguel
 Blog: http://lonifasiko.blogspot.com
 




-- 
Si l'ignorance peut servir de consolation, elle n'en est pas moins illusoire.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: PagingScrollTable: JavaScriptException

2008-11-28 Thread hezjing
Hi

Hmmm ... it seems that the JavaScriptException is gone after calling
setSize() on the PagingScrollTable,

PagingScrollTableSerializable scrollTable = new
PagingScrollTableSerializable(cachedTableModel, dataTable, headerTable);
// throw JavaScriptException if the following is omitted ...
scrollTable.setSize(95%, 50%);

but why?


On Fri, Nov 28, 2008 at 12:01 AM, hezjing [EMAIL PROTECTED] wrote:

 Hi
 I encounter the following exception in hosted mode while trying to create a
 PagingScrollTable,

 [ERROR] Uncaught exception escaped
 com.google.gwt.core.client.JavaScriptException: (Error): Invalid argument.
  number: -2147024809
  description: Invalid argument.
 at com.google.gwt.dom.client.Style$.setProperty$(Native Method)
 at com.google.gwt.user.client.DOM.setStyleAttribute(DOM.java:1201)
  at
 com.google.gwt.widgetideas.table.client.ScrollTable.resizeTablesVerticallyNow(ScrollTable.java:1311)
 at
 com.google.gwt.widgetideas.table.client.ScrollTable$1.execute(ScrollTable.java:602)
  at
 com.google.gwt.user.client.CommandExecutor.doExecuteCommands(CommandExecutor.java:311)
 at
 com.google.gwt.user.client.CommandExecutor$2.run(CommandExecutor.java:206)
  at com.google.gwt.user.client.Timer.fireImpl(Timer.java:164)
 at com.google.gwt.user.client.Timer.fireAndCatch(Timer.java:150)
  at com.google.gwt.user.client.Timer.fire(Timer.java:142)


 Do you have any idea of what could be the problem?
 I'm using gwt-incubator_1-5_Sept_04.zip.


 Thank you!


 --

 Hez




-- 

Hez

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



DOM.setStyleAttribute questions

2008-11-28 Thread yilativs

Recently I've found out that DOM.setStyleAttribute as well as
getElement().getStyle()
do not work for valid properties. At first I thought that it doesn't
work at all but lately I found out that there are very few properties
for which it works:

Image image = new Image(images/someimage.gif);
DOM.setStyleAttribute(image.getElement(), margin-left, 15px);//
does nothing
instead I found out that it works with
DOM.setStyleAttribute(image.getElement(), marginLeft, 15px);//
works

DOM.setStyleAttribute(image.getElement(), coLLLor, red);//does
nothing
DOM.setStyleAttribute(image.getElement(), color, red);//does
nothing
DOM.setStyleAttribute(image.getElement(), color, rad);//throws
Invalid property value.


I found no documentation on such... let's say not evident behavior.

Does anybody know why gwt developers changed margin-left to
marginLeft? (I guess they use some BeanUtils for this stuff)
why they throw exception on wrong property value but not on wrong
property name?
and
why  they do nothing when the property name is correct (like with
color, yes, I know Image does not have such property).

Regards
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Support for X.509 certificates

2008-11-28 Thread Lothar Kimmeringer

Lonifasiko schrieb:
 Maybe I'm asking a stupid question, but support for X.509 certificates
 concerns to GWT or to the application server I'm using, JBoss in my
 case?

It concerns the application-server and the browser the GWT-application
is being executed (e.g. if we are talking about certificate-based
client-authentication when doing HTTPS-communication).


Regards, Lothar

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Pbm with gwt-voices and FireFox

2008-11-28 Thread Mogoye

I'm trying to use GWT voices to play audio in a web app but I've got a
problem with firefox.
Each time I try to play a file with firefox, it ask me to install some
additionnal plugins (Quick-time).

I've installed it severals times but I've always got the same popup
and I can't play any sound.

This problem is available with the test page given under GWT-voice
project :
http://allen-sauer.com/com.allen_sauer.gwt.voices.demo.VoicesDemo/VoicesDemo.html

Is there something to do to configure plugin correctly ?
Does somebody succeeds in using gwt-voice with firefox ?

Thx for reading.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: How to do cross site implementation in GWT

2008-11-28 Thread Manish Kumar

Hi Guys,

Any idea on this.

Maniish
- Original Message - 
From: Manish Kumar [EMAIL PROTECTED]
To: Google-Web-Toolkit@googlegroups.com
Sent: Friday, November 28, 2008 1:05 PM
Subject: Re: How to do cross site implementation in GWT



 Hi,

 There is a bit change in approach. Somehow i am now able to connect to GWT
 from my external HTML/website.
 The way I have done is on click of a button in my html , I open a new 
 window
 which loads the GWT Host HTML which in turns calls a JSNI method.
 The problem is now to pass some parameter from my website/HTML to GWT 
 native
 method.

 Please help me out to get some way.

 Thanking you for much needed help  co-operation.

 Regards
 Manish

 - Original Message - 
 From: Manuel [EMAIL PROTECTED]
 To: Google-Web-Toolkit@googlegroups.com; [EMAIL PROTECTED]
 Sent: Thursday, November 27, 2008 1:26 AM
 Subject: Re: How to do cross site implementation in GWT



 One thing I just noticed in your code is that you are  exporting java
 methods to javascript. When I tryied that a few weeks ago I could not
 figure out how the instance expression part worked, so I only have
 tried this with static methods
 e.g.

 public static int displayDialog(String companyId, String companyName) {
 ResponseDialog.getInstance().doSplash(companyId, companyName);
 return 0;
 }
 public static native void exportJavaMethod() /*-{
 $wnd.sendEmail =
 @com.fbg.client.Emailer::displayDialog(Ljava/lang/String;Ljava/lang/String;);
 }-*/;
 and then calling the function from any javascript code in the host as
 sendEmail(id, name)

 Perhaps you can try changing PMGWTHtmlUtils::invokeGWT to be a static
 function


 On Wed, Nov 26, 2008 at 11:32 AM, Manuel [EMAIL PROTECTED] wrote:
 I pretty much followed the steps detailed in

 http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=FAQ_JSONFeedsFromOtherDomain

 Plus I am passing parameters via javascript variables in the host
 page. The code in the host page looks like:

 script type=text/javascript
var fbg_customerId = '238976';
var fbg_type = 'vertical';
 /script
 script type=text/javascript language=javascript
 src=http://www.gov-world.com/gwt/com.fbg.headlinesreader.HeadlinesReader.nocache.js;/script
 div id=fbgPressReleases
 /div

 in the onModuleLoad() function I call the following native function to
 read the javascript variables

public native void getParameters() /*-{

 [EMAIL PROTECTED]::parameter_id =
 $wnd.fbg_customerId;

 [EMAIL PROTECTED]::parameter_format
 = $wnd.fbg_type;
 }-*/;

 and after that I call the makeJSONRequest() function which is declared
 as follows:


public static native void makeJSONRequest(String url, JSONHandler
 handler) /*-{
$wnd.jsonCallback = function(jsonObj) {

 @com.fbg.headlinesreader.client.HeadlinesReader::dispatchJSON(Lcom/google/gwt/core/client/JavaScriptObject;Lcom/fbg/headlinesreader/client/JSONHandler;)(jsonObj,
 handler);
}

// create SCRIPT tag, and set SRC attribute equal to JSON
 feed URL +
 callback function name
var script = $wnd.document.createElement(script);
script.setAttribute(src, url+jsonCallback);
script.setAttribute(type, text/javascript);

 $wnd.document.getElementsByTagName(head)[0].appendChild(script);

}-*/;

public static void dispatchJSON(JavaScriptObject jsonObj,
 JSONHandler
 handler) {
handler.handleJSON(jsonObj);
}

public void handleJSON(JavaScriptObject obj)  {
// String s;
if (obj == null) {
// grr
return;
}

JSONArray myarr;
JSONObject myObj;
myarr = new JSONArray(obj);
for (int i=0; imyarr.size();i++) {
myObj = myarr.get(i).isObject();
headlines.add(  new Headline(

 myObj.get(title).isString().stringValue().trim(),

 myObj.get(link).isString().stringValue().trim(),

 myObj.get(create_date).isString().stringValue().trim()
) );
}
showNews();  //and this finally adds widgets to the
 element
 fbgPressReleases in the host page
}



 I read that there was an inssue with firefox 3 and IE7 that made
 difficult to access the window object of a webpage from a script
 loaded from a different domain, so my Assumption is that the
 add-linker name=xs / in the configuration signals GWT to work
 around this issue




 On Tue, Nov 25, 2008 at 8:36 PM, Manish Kumar [EMAIL PROTECTED]
 wrote:

 Hi Manuel,

 Thanx for response.But I wanna know how do you passing the parameter
 from
 our website/HTML to gwt component.
 is this by using JSNI.if yes , how do attached your compiled gwt app
 source
 to your website/html.This point is crucial for me
 since i am not able to connect to gwt from our 

Re: Image - setting image via css

2008-11-28 Thread Thomas Broyer


On 28 nov, 12:48, Michel [EMAIL PROTECTED] wrote:
 Hello there.

 When we use the Image class, we can set the image via the setUrl
 command.

 Fine.

 But now I wanted to set the image which is defined in a css class

 Is it possible to use Image for this?

It might not be the best choice but yes: just setUrl
(GWT.getModuleBaseURL() + clear.cache.gif) and addStyleName.
And in your CSS, set your image as a background-image (and set the
width and height too!)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Is it possible to implement keyboard accessible Popup menus?

2008-11-28 Thread [EMAIL PROTECTED]

I guessed the silence is that there isn't any support for this. So I
wrote a subclass of PopupPanel that responds to keyboard events. It
would be nice to navigate popup menus with arrow keys but I can live
with shortcuts.

public class PopupPanelWithKeyboardShortcuts extends PopupPanel {

private HashMapCharacter, Command keyCommandMap =
new HashMapCharacter, Command();

public PopupPanelWithKeyboardShortcuts(boolean autoHide) {
super(autoHide);
}

@Override
public boolean onKeyPressPreview(char key, int modifiers) {
Command command = keyCommandMap.get(key);
if (command != null) {
command.execute();
};
hide();
return super.onKeyPressPreview(key, modifiers);
}

public void addKeyCommand(Character character, Command command) {
keyCommandMap.put(character, command);
}

}

On Nov 25, 10:39 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Greetings,

 I've been successfully using a PopupPanel with a MenuBar as its
 widget. However it doesn't seem to be accessible via the keyboard.
 I've 
 readhttp://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideAcce
 I've tried wrapping the MenuBar in a FocusPanel but it seems to have
 no effect.

 Any suggestions?

 Thanks in advance,

 -ken
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: javascript error getBoxObjectFor ?

2008-11-28 Thread Ed

He Summit,

Browser: FF 2 (latest update).
I was trying this the last few days, but get the exact same error as
in this issue, so pretty mode isn't an option yet till 1.6 comes out:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/5d6a9c448a82b916/af62e5877237b107?lnk=raot

Can you give me some details why and when this method is called ? (I
noticed it in the gwt source code, but it's a bit unclear when/how
it's used).
Is this a common error as far as you know ?

-- Ed

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: SmartGWT 1.0 Released

2008-11-28 Thread Edwin Nathaniel

Debugging in Firebug is something that I'd like to avoid as much as I
can. Especially for a GWT app which usually are pretty big. The nice
thing about Ext-GWT is that I don't need to do that (probably once in
the blue moon on a very extreme case).

Knowing the internal Ext-GWT which is written in pure GWT also helps a
lot. How about SmartGWT ? Do I need to know all the JS stuffs?
Eventually I do if I want to do something more than the framework has
to offer.

I suppose one nice thing about wrapping JS is that you only deal with
one low-level code-base. Other than that, I don't see any advantage.
At the end of the day, I can only wish SmartGWT takes Ext-GWT
approach. Last time I did a lame comparison on Ext-GWT and GWT-ext,
Ext-GWT is much snappier compare to GWT-ext.

I have couple questions though:

1) How do you guys do deferred binding in SmartGWT/SmartClient?
2) How do you optimize SmartClient for a specific browser?
3) How does the serialization work? if I recall last time, in GWT-ext
someone has to purchase something else?

On Nov 24, 10:56 am, ckendrick [EMAIL PROTECTED] wrote:
 Lest anyone get the wrong idea from francesco, when using SmartGWT you
 can debug your GWT *application* code normally within hosted mode.

 If you had a need to debug the core SmartClient libraries (normal
 users will not have a need to do this), you'd use debugging tools like
 Firebug and SmartClient's Developer Console.  Calling this being out
 in the cold is bit of hyperbole given that SmartClient's very long
 track record of success has always been based on this approach, which
 works well, and will work even better with the next crop of browsers,
 *all* of which have Firebug clones.

 Finally, on performance - the real world performance of enterprise
 RIAs is dominated by the number of trips to the server and the
 intensity of database load.  In this extremely key aspect - again the
 primary determinant of real-world performance - SmartClient/SmartGWT
 has a very dominant lead, which is due to it's sophisticated data
 binding architecture (particularly adaptive client-side operations and
 intelligent data caching).  By comparison, possible code size
 differences caused by a different mix of JSNI vs Java code is at best
 a 3rd or 4th tier performance concern, and is frequently has literally
 zero impact on actual performance of delivered applications.

 Using JSNI has distinct advantages - as Sanjiv touched on, we are able
 to optimize things at a very low level within the SmartClient runtime,
 and we can more easily profile and tune core framework code because
 it's not going through a Java-JavaScript translator.  This is very
 much like the mix of native C++ and higher level languages like C#
 within a .NET CLR - different languages for different tasks.
 Personally, for the kinds of applications that SmartGWT is designed
 for, I see it as a tremendous architectural advantage.

 On Nov 24, 12:32 am, francescoNemesi [EMAIL PROTECTED] wrote:

  Hi Sanjiv,

  thanks for your reply, agree with your comments. Re-reading my post I
  agree it might look like I was, in a way, attachingsmartGWT. It was
  not meant to come through that way, nor was my intention to praise
  GXT.

  It was only meant to be a comparison between approaches, JSNI vs Pure
  GWT, and I definetely think that using JSNI as the foundation of any
  GWT framework is not the right thing to do. Smart Client is an amazing
  framework, but it is a JavScript framework. Using JSNI leaves you in
  the cold when you need to debug, as an example, but I am sure you know
  all that.

  I think you have done a great job withsmartGWT, it looks really great
  and I am sure it will have the success it deserves.

  Regards,
  Francesco

  On Nov 23, 8:34 pm, Sanjiv Jivan [EMAIL PROTECTED] wrote:

   Hi Fransceso,
   If you found a library that meets your needs, then good for you.
   Compile output size and runtime performance are two separate issues. A 
   third
   party widget written in GWT Java, regardless of how small it compiles down
   to, doesn't magically make it run fast. Nor does it make it magically 
   render
   perfectly on all browsers. As an example a TableGrid written in GWT Java
   could still perform really poorly, and not display consistently on all
   browsers.  There are obviously several aspects to GWT that helps avoid 
   leaks
   and such but this does not mean that any third party code written in GWT 
   is
   100% leak free. The GWT 1.6 event API is really neat andSmartGWTusers
   it. Well written code is what will perform well and display consistently
   across various browser.

   On the issue of performance, there are numerous posts made by paying GXT
   users that the performance of GWT-Ext is still better than GXT. You can
   search their forums. This is not to suggest that performance improvements
   cannot be made inSmartGWT. If you can give specifics, it would certainly
   help in resolving them. But without specifics like whether it was 

Portlet Layout - Similar to iGoogle

2008-11-28 Thread StrongSteve

Hi Everybody!

I have a very basic question and you hope you can provide me an
answer! ;)

So basically I have an existing web-application consisting of several
JSP/HTML pages that provide different simple tasks.

What I want to do now, is change the user interface in a way, that it
looks like the main screen of iGoogle.

So that I have a wide area with different widgets, that can be dragged
around, hidden, ...
Within each widget I want to display one of my existing Java Server
Pages.

Is this possible with GWT? Or do I need additional libraries to
support this behaviour.

Can you please point me out the major steps that would be necessary to
reach this goal?

Thanks in Advance for both your time and your knowledge!

Greetings
Stefan

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Deferred binding based on annotation

2008-11-28 Thread rmuller

Hallo,

Is it possible to trigger deferred binding based on an annotation, so:

generate-with class=example.rebind.FooGenerator
  when-*annotated* class=example.client.Baz /
/generate-with

So you can use it like this:
Foo foo = GWT.create(class annotated by Baz)

Regards,

Ronald

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Problem with the import java.security.*;

2008-11-28 Thread Phani

Hi All,

In my application i have to implement a unique number generation i.e
UUID using SecureRandom class of java.security package. Please refer
the below code.
try {
// Create a secure random number generator
SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
// Get 1024 random bits
byte[] bytes = new byte[1024/8];
sr.nextBytes(bytes);

// Create two secure number generators with the same seed
int seedByteCount = 10;
byte[] seed = sr.generateSeed(seedByteCount);
sr = SecureRandom.getInstance(SHA1PRNG);
sr.setSeed(seed);
SecureRandom sr2 = SecureRandom.getInstance(SHA1PRNG);
sr2.setSeed(seed);
} catch (NoSuchAlgorithmException e) {
}
But i'm facing a problem stating that java.security cannot be resolved
to a type. Please help me.Whether  GWT doesn't support java.security
package?
Thanks in Advance,
Phani.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Problems adding a Digg This link

2008-11-28 Thread mayop100

I'm trying to add a Digg This link to my gwt website. If my website
were just an html page, all I would need to do is include this line in
my HTML:
script src=http://digg.com/tools/diggthis.js; type=text/
javascript/script

I've tried adding a new element to the page with DOM.createElement
(script), but it ends up replacing the entire contents of the page
with my digg link. I've also tried a JSNI solution, but with no
success.

It seems to me there should be an easy solution for this... anyone?

Thanks -

-Andrew


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Problem with the import java.security.*;

2008-11-28 Thread Peter Ondruška

I do not think you can do that with GWT. Therefore I use
http://uuid-service.appspot.com though not with GWT application.
Peter

2008/11/28, Phani [EMAIL PROTECTED]:

 Hi All,

 In my application i have to implement a unique number generation i.e
 UUID using SecureRandom class of java.security package. Please refer
 the below code.
 try {
 // Create a secure random number generator
 SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
 // Get 1024 random bits
 byte[] bytes = new byte[1024/8];
 sr.nextBytes(bytes);

 // Create two secure number generators with the same seed
 int seedByteCount = 10;
 byte[] seed = sr.generateSeed(seedByteCount);
 sr = SecureRandom.getInstance(SHA1PRNG);
 sr.setSeed(seed);
 SecureRandom sr2 = SecureRandom.getInstance(SHA1PRNG);
 sr2.setSeed(seed);
 } catch (NoSuchAlgorithmException e) {
 }
 But i'm facing a problem stating that java.security cannot be resolved
 to a type. Please help me.Whether  GWT doesn't support java.security
 package?
 Thanks in Advance,
 Phani.

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: SecureRemoteService and Servlet. The battle against XSRF.

2008-11-28 Thread Shawn Pearce
On Fri, Nov 28, 2008 at 03:52, Patrick Ratelband [EMAIL PROTECTED]wrote:


 I have been working a while now on properly defending my GWT app
 against Cross Site Request Forgery (XRSF) with a minimal change in the
 code of the application itself.


I've done something similar for an application I am working on, but the RPC
format uses pure JSON rather than the GWT RPC system.  For the most part it
serializes just about anything GWT RPC would serialize, but the object
property names appear plain text on the wire.  The advantage of course is
non-GWT clients and servers can actually speak to each other.  Standard JSON
along with automatic XSRF were my main requirements.  The application I am
using it in is open source, I don't want to be obfuscating the wire
protocol.

The RemoteJsonServlet base class automatically handles XSRF key generation
and validation, so you extend it and implement your interface.  The client
side proxies are generated to automatically insert the XSRF token into the
HTTP request headers.  So its fairly transparent to the application.

Its still under development, but I'm using it in Gerrit 2, and thus far its
working out quite nicely for my needs.

Code is here:

  http://android.git.kernel.org/?p=tools/gwtjsonrpc.git;a=summary

README describing it in a bit more detail:


http://android.git.kernel.org/?p=tools/gwtjsonrpc.git;a=blob;f=README;hb=HEAD

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Masked Input

2008-11-28 Thread jsantaelena

Hi

Someone knows libe with masked widgets?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: SecureRemoteService and Servlet. The battle against XSRF.

2008-11-28 Thread Reinier Zwitserloot

The solution is simple: Rewrite the session management part of your
web stack so that it doesn't look at the cookie (it should completely
ignore the cookie - it is there only to let the session survive when
the user reloads the page / closes their browser), instead lifting the
session out of the parameters. You don't need to remove it, really -
any framework or servlet engine that gives unfettered access to the
parameters also gives unfettered access to the cookies, so there's no
point.

gregor: What do you mean 'bad idea because the session ID would be
visible on the wire'? All session IDs are visible on the wire, unless
you set up a scheme where the client javascript does some hashing or
encryption. It's been floated as an idea many times on this forum, and
it is certainly feasible, but its very much outside of the norm.
Virtually nobody on the entire web is doing this today. There are a
number of issues I don't really want to get into. Suffice to say: Yes,
doable. Yes, very cool. No, not standard or required by any stretch of
the imagination. Such a scheme would still be significantly less
secure than SSL, because it won't hold up to a man in the middle
attack (the man in the middle will just modify your GWT code to send
the password to his secret server in nigerussomania.

On Nov 28, 12:52 pm, Patrick Ratelband [EMAIL PROTECTED] wrote:
 Hey everyone,

 I have been working a while now on properly defending my GWT app
 against Cross Site Request Forgery (XRSF) with a minimal change in the
 code of the application itself.

 My idea has been to create a new RPC call that will be the same from
 the programmers points of view as the normal, but which will add some
 value (a sessionID for instance) to the list of supplied parameters
 just before the call is send. Then, on the server side, the programmer
 would extend the SecureRemoteServiceSevlet (SRSS) instead of the
 normal one. This secure version will simply remove the extra
 paramater, check it's validity and only execute the requested method
 if the authentication succeeds.

 So far I have been able to subclass the RemoteServiceServlet (RSS)
 into the SRSS. It overrides the processCall(String payload) method to
 implement the verification (in my case the last argument, but that can
 easily be changed), thus working exactly the same as the normal RSS
 without any change needed in the code other than changing the extend.

 The problem is that I really do not understand where I might add the
 code to modify the sending of the request client side. I have studied
 the RPC diagrams and almost everything I could find on the group
 concerning RPC, but I still do not understand what I need to change or
 override to create a custom RPC call. I have thought about making a
 subclass of the ServiceDefTarget so that the calling URL could be
 modified, but this is an interface and not a class, so is not going to
 work.

 Does anyone have any idea's on this?

 Patrick

 PS: If I succeed at making something useful, I will create a package
 and a tutorial to share my knowledge. No need to reinvent the wheel.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: SecureRemoteService and Servlet. The battle against XSRF.

2008-11-28 Thread gregor

@Reinier


 gregor: What do you mean 'bad idea because the session ID would be
 visible on the wire'? All session IDs are visible on the wire, unless
 you set up a scheme where the client javascript does some hashing or
 encryption.

Suppose I replaced:

 sessionID = someSessionIDCookieGrabbingMethod();

with:

 sessionID = someReinierApprovedEncryptionAlgorithm();

would this meet with your approval? If not can you explain why?

regards
gregor





It's been floated as an idea many times on this forum, and
 it is certainly feasible, but its very much outside of the norm.
 Virtually nobody on the entire web is doing this today. There are a
 number of issues I don't really want to get into. Suffice to say: Yes,
 doable. Yes, very cool. No, not standard or required by any stretch of
 the imagination. Such a scheme would still be significantly less
 secure than SSL, because it won't hold up to a man in the middle
 attack (the man in the middle will just modify your GWT code to send
 the password to his secret server in nigerussomania.

 On Nov 28, 12:52 pm, Patrick Ratelband [EMAIL PROTECTED] wrote:

  Hey everyone,

  I have been working a while now on properly defending my GWT app
  against Cross Site Request Forgery (XRSF) with a minimal change in the
  code of the application itself.

  My idea has been to create a new RPC call that will be the same from
  the programmers points of view as the normal, but which will add some
  value (a sessionID for instance) to the list of supplied parameters
  just before the call is send. Then, on the server side, the programmer
  would extend the SecureRemoteServiceSevlet (SRSS) instead of the
  normal one. This secure version will simply remove the extra
  paramater, check it's validity and only execute the requested method
  if the authentication succeeds.

  So far I have been able to subclass the RemoteServiceServlet (RSS)
  into the SRSS. It overrides the processCall(String payload) method to
  implement the verification (in my case the last argument, but that can
  easily be changed), thus working exactly the same as the normal RSS
  without any change needed in the code other than changing the extend.

  The problem is that I really do not understand where I might add the
  code to modify the sending of the request client side. I have studied
  the RPC diagrams and almost everything I could find on the group
  concerning RPC, but I still do not understand what I need to change or
  override to create a custom RPC call. I have thought about making a
  subclass of the ServiceDefTarget so that the calling URL could be
  modified, but this is an interface and not a class, so is not going to
  work.

  Does anyone have any idea's on this?

  Patrick

  PS: If I succeed at making something useful, I will create a package
  and a tutorial to share my knowledge. No need to reinvent the wheel.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Deploying servlets

2008-11-28 Thread jonbutler88

Hi

I am using GWT.getModuleBaseURL(), so I changed my Clod.gwt.xml file,
and ive managed to get the RPC services to error now, because it is
looking for  /Cloud//RPCService.

Ive tried getting the 'Service doesnt accept GET' message (when you
try to access a sevice directly), but I cant find it now. Ive tried:

/Cloud/RPCService
/com.cloud.Cloud/RPCService
/com/cloud/Cloud/RPCService
/RPCService

None of these get me the message, so im not sure how to configure my
xml file, as I dont know where the service is now mapped to. I am
using this line:

target.setServiceEntryPoint(GWT.getModuleBaseURL() + /RPCService);

and the corespoinding line in my .gwt.xml file:

servlet path=/RPCService class=com.cloud.server.RPCServiceImpl /

Should I change the servlet-path?

Thanks,
Jon

On Nov 27, 10:03 pm, gregor [EMAIL PROTECTED] wrote:
 Hi Jon,

 If you are using:

 GWT.getModuleBaseURL() + DBService

 to make the URL for the call to com.cloud.server.DBServiceImpl it
 might not work deployed (as it does in Hosted mode).

 Try changing your url-pattern to:

 servlet-mapping
     servlet-nameDBService/servlet-name
     url-pattern/com.foo.bar.MyModule/DBService/url-pattern
   /servlet-mapping

 where my module is whatever your gwt.xml module file is (minus
 the .gwt.xml).

 On Nov 27, 8:56 pm, jonbutler88 [EMAIL PROTECTED] wrote:

  Hi all,

  Been using GWT for a few weeks, very impressed with the ease of
  development, but have run into some small troubles deploying the app.
  I have tomcat 6 set up with JRE 6 on a box, here are the steps I have
  made so far:

  Compiled using the script with GWT, got the www directory, and added a
  WEB-INF folder, with a web.xml file, /lib and /classes. here is my
  web.xml:

  ?xml version=1.0 encoding=UTF-8?
  web-app
    display-nameCloud Online/display-name

    servlet
      servlet-nameRPCService/servlet-name
      servlet-classcom.cloud.server.RPCServiceImpl/servlet-class
    /servlet

    servlet
      servlet-nameDBService/servlet-name
      servlet-classcom.cloud.server.DBServiceImpl/servlet-class
    /servlet

    servlet-mapping
      servlet-nameRPCService/servlet-name
      url-pattern/RPCService/url-pattern
    /servlet-mapping

    servlet-mapping
      servlet-nameDBService/servlet-name
      url-pattern/DBService/url-pattern
    /servlet-mapping

    welcome-file-list
      welcome-fileCloud.html/welcome-file
    /welcome-file-list
  /web-app

  In /lib I have Cloud.jar (exported using eclipse from the src
  directory) and gwt-servlets.jar (not sure whats in here). In /classes
  I have my 2 remote servlet classes, exported from eclipse
  individually.

  I make a zip file from the compiled contents + the WEB-INF folder, and
  rename it to Cloud.war

  I then upload and deploy into tomcat environment using the tomcat
  manager.

  I can get the static content of the site (compiled js), but I cant
  seem to get the RPCService or DBService to work. Can anyone see that
  im missing some steps, or doing something wrong?

  Thanks, sorry for the long post.

  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



URL listener?

2008-11-28 Thread cristian.vrabie

Hi guys!

It is nice to alter the url with the content so we can always come
back by just accessing the url. I'm sure you know that to do this
without actually reloading the page you can append #parameters. For
example changing from

http://mypage.com/product#id=4 to http://mypage.com/product#id=53

would not reload the page because it's basically the same, but can
show different content by parsing the id parameter from the url.

My question is if there's a way to listen to a URL change? The only
think I've come up till now is to periodically check for a change in
the url, but that's always a bad move. Any ideas?

Thanks!
Cristian

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



XML to UI Forms

2008-11-28 Thread Startworld67

Hi,

Maybe, I am too lazy but is there a way for gwt to convert whats in
XML (formatted according to gwt requirements) which can parse and
construct the form and allow the users to edit and once done, saves to
the xml again for future processing.

I am trying to avoid learning GWT specific UI elements and gain
control from some wrappers which load from xml and save to xml.

Something close would be
http://extjs.com/examples/grid/editable.html
http://extjs.com/examples/forms/advanced.html

but they should be read from xml and built upon.

Sure, I can write the wrappers but I was checking if someone has done
this before. A UI-xml framework?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: URL listener?

2008-11-28 Thread Shawn Pearce
See the History class, and the HistoryListener interface:

http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/History.html

On Fri, Nov 28, 2008 at 11:34, cristian.vrabie [EMAIL PROTECTED]wrote:


 Hi guys!

 It is nice to alter the url with the content so we can always come
 back by just accessing the url. I'm sure you know that to do this
 without actually reloading the page you can append #parameters. For
 example changing from

 http://mypage.com/product#id=4 to http://mypage.com/product#id=53

 would not reload the page because it's basically the same, but can
 show different content by parsing the id parameter from the url.

 My question is if there's a way to listen to a URL change? The only
 think I've come up till now is to periodically check for a change in
 the url, but that's always a bad move. Any ideas?

 Thanks!
 Cristian

 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Theme ?

2008-11-28 Thread Riyaz Mansoor


How does one theme a custom widget with panels? where the panels have
some customized formatting.

For that matter, how does one theme any widget?

Riyaz
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Pass an applicationSessionId in each rpc request

2008-11-28 Thread Joe Cole

You could just change the request urls:

target.setServiceEntryPoint(GWT.getModuleBaseURL() + / + service
+;sessionid=+sessionId);

I haven't tried it, but assume it would work. You would have to pull
out the appropriate information on the server side.
Joe

On Nov 28, 5:35 am, seb2nim [EMAIL PROTECTED] wrote:
 Hi everyone.

 I was playing with cookie and session and i found i cant open two
 different tabs on firefox with twice the same app... so i think i'm
 doing something wrong : I was thinking there would be two different
 httpSessions but apparently not.

 the problem is i actually keep some user information in httpsession...
 So two apps shares the same information wich is, really bad.

 I decided to generate a unique 'application level session id' at login
 so that i can manage multiple in one httpsession.

 Drawback is that once passed to client-side code, i need to pass it on
 every rpc call... and i'm a lazy guy... I dont want to refactor each
 method signature...

 As RPC mecanism is now improved in GWT1.5 :
 The first is that asynchronous interface methods can now return the
 underlying HTTP request object (http.client.Request) so you can access
 and tweak it as necessary for your application needs before sending it
 off through RPC. Asynchronous interface methods can now also return
 void or http.client.RequestBuilder objects.

 I think i can tweak my calls to append the appSessId in header or
 something like that. Did anyone already do this?

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



File download using GWT?

2008-11-28 Thread rlaferla

Here's a tricky one for you GWT experts!

In my application, I need to dynamically create a text file (in
memory) and allow the user to download it.  In a traditional web
application, this is easy.  However, how can you do this with GWT?
Before you answer, keep in mind that the file does not exist on disk
anywhere.  Therefore, a GWT-RPC service would send a String back to
the GWT client and the client would have to do something to trigger
the download of that string as a file.  I have already searched this
forum and there is a thread on doing a file download but that's for a
file that exists on disk and for various reasons, my application
cannot write the string to a file first.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



ClickListener problem

2008-11-28 Thread tapan

I have 3 buttons each having their own ClickListener . The problem is
that after clicking once on a button the ClickListener does not work
second time until the page has been refreshed. How can i correct this
error without refreshing the page every time.
Please help

Sincerely
Tapan Chugh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Timer In Gwt

2008-11-28 Thread jagadesh

Hi Guys,

I am Working On A Screen Where i Need to Display some Error Message
and Some Success Messages.What i did is i created my own widget of
some Label type . when ever i need to show a message i would set the
text to label and display it on the top of the screen much like gmail.

the issue i added a timer for the label so that it disappears
automatically after some time.

i have written the code like this,

Timer t = new Timer() {
public void run() {
header.setErrorMessage(Error Message);
header.setVisible(true);
setWidget(0, 1, header);
}
};
t.schedule(500);

header is my label type of element. i was displaying some 30 types of
different message. so my timer code has increased a lot . can any one
suggest me how to use a single timer class for all.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



TextArea cannot be resolved to a type

2008-11-28 Thread moe374

Hello. I have just begun learning java (about 2 months ago) and am now
trying to develop a couple applications for the web using java and the
GWT. I am having some difficulty and hoping someone can help me out.
My first problem I am having is I am getting this error message
TextArea cannot be resolved to a type when I am trying to create a
text area. I get the error message twice, and for the same line in my
code which is

TextArea ta = new TextArea();

Is there a line (or multiple lines) of code I have to implement before
I can implement the TextArea object?

Also, I need to allow the user to paste some information into this
text box and allow me to store that information in a variable, and
then do something with the information, and then output some
information to the user (even in the same text box is fine). Can some
one please help me get started on this?

Finally, I was wondering if the GWT supports reading the HTML file of
a URL, which would normally be done by something like this:

URL results = new URL(http://www.some-url.com;);

BufferedReader in2 = new BufferedReader(
new InputStreamReader(
results.openStream()));
String inputLine = in2.readLine();

Thank you very much.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



[gwt-contrib] Re: gen2 tables: Create TableDefinition based on annotations

2008-11-28 Thread dflorey

Uuups, only working in hosted mode :-(

On 27 Nov., 13:07, dflorey [EMAIL PROTECTED] wrote:
 Hi,
 I've used that Generator stuff in gwt for the first time and I've to
 admit that it is really cool!
 I've been using it to simplify the creation of model based gen2-
 tables. Instead of defining the TableDefinition programmatically you
 now have the alternative to do it with annotations in your domain
 class.
 Example:

 public static class Ancestor extends AbstractTreeTableItem implements
 RowValue {
   private String firstName, lastName;
   private double iq;
   private Date dateOfBirth;

    public Ancestor(String firstName, String lastName, int iq, Date
 dateOfBirth) {
     this.firstName = firstName;
     this.lastName = lastName;
     this.iq = iq;
     this.dateOfBirth = dateOfBirth;
   }

   @ColumnDefinition(column = 0, header = First name, filterable =
 false)
   public String getFirstName() {
     return firstName;
   }

   @ColumnDefinition(column = 1, header = Last name)
   public String getLastName() {
     return lastName;
   }

   @ColumnDefinition(column = 2, header = IQ, numberFormat =
 NumberColumnFormat.SCIENTIFIC_FORMAT)
   public double getIq() {
     return iq;
   }

   @ColumnDefinition(column = 3, header = Date of birth,
 dateTimeFormat = DateColumnFormat.SHORT_DATE_FORMAT)
   public Date getDateOfBirth() {
     return dateOfBirth;
   }

   @Override
   public String getDisplayName() {
     return firstName +   + lastName;
   }

   @Override
   public String getId() {
     return firstName + lastName + dateOfBirth;
   }

 }

 Note that you have to implement the RowValue marker interface. Now you
 are ready to create your TableDefinition like this:

 TableDefinitionAncestor tableDefinition = GWT.create
 (Ancestor.class);

 Very cool! Thanks for this brilliant toolkit!!
--~--~-~--~~~---~--~~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~--~~~~--~~--~--~---