Re: Overlay Instantiation from within JavaScript

2012-05-29 Thread WebDude
On Tuesday, May 29, 2012 1:15:58 PM UTC-7, Thomas Broyer wrote:
>
>
>
> On Tuesday, May 29, 2012 9:46:32 PM UTC+2, WebDude wrote:
>>
>> I have a simple JavaScript overlay class.
>> How do I instantiate an instance of this class from within JavaScript 
>> (JSNI)?
>>
>
> The whole point of overlays is that they're not real classes, they're not 
> things that you instantiate (they "map" a JS object into the Java world), 
> and they don't correspond to a JS "class".
> So create whatever object in JS that has the properties and "methods" that 
> the overlay "maps" to Java, and you're done.
> An overlay class is only a Java "view" on JS objects, so you can 
> manipulate it in Java as if it were a Java object.
>

Ah, got it.  Thanks! 

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



Overlay Instantiation from within JavaScript

2012-05-29 Thread WebDude
I have a simple JavaScript overlay class.
How do I instantiate an instance of this class from within JavaScript 
(JSNI)?

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



PopupPanel Align Right

2009-04-01 Thread WebDude

Is it possible to align a PopupPanel with the right side of the window
or the right side of a panel?

I know that it could be done by getting the size of the window and
setting the position of the PopupPanel based on that.  However, if
window is re-sized, the popup won't move with the re-size.  This would
be a simple "align: right" style attribute in CSS, but it gets ignored
every time that I try to use it with a PopupPanel.

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



Set Position Relative to Right Side of a Panel

2009-03-27 Thread WebDude

I would like to position a Popup or a Label, or even just an Image
relative the right side of each of the panel in a
HorizontalSplitPanel.
Something like what I have drawn below where '*' is the Popup, Label,
or Image.

I can't get the position of the object so that it will stay with the
right side.
I know it can't be that difficult, but I'm at a bit of a loss.


-
|  *  |   *  |
| |   |
| |   |
| |   |
| |   |
-
--~--~-~--~~~---~--~~
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: Dialog Box Appears Behind Another Widget

2008-12-16 Thread WebDude

Thanks.  Unfortunately, no combination of show/hide seems to fix the
problem for me.

On Dec 15, 4:53 pm, rakesh wagh  wrote:
> never used openlayers...
> but try this:
> for your dialog box, where you do dialoBox.show(), call the .hide()
> method first and then call ..show();
>
> or try .show() .hide() .show in a sequence and see if it works... its
> basically about setting the proper z-index.
>
> On Dec 15, 3:26 pm, WebDude  wrote:
>
> > I'm using the gwt-OpenLayers plug-in.  In Firefox and Chrome, any
> > DialogBoxes appear beneath the Map widget.  It makes things a little
> > tricky for modal dialogs.  In Hosted mode and IE it works fine.
>
> > I've dried modifying the zIndex of the dialogs and the map to force
> > the dialogs to appear on top.  I am unable to get the dialogs to be in
> > front.
>
> > Any ideas on how to get the dialogs on top?
>
> > 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
-~--~~~~--~~--~--~---



Dialog Box Appears Behind Another Widget

2008-12-15 Thread WebDude

I'm using the gwt-OpenLayers plug-in.  In Firefox and Chrome, any
DialogBoxes appear beneath the Map widget.  It makes things a little
tricky for modal dialogs.  In Hosted mode and IE it works fine.

I've dried modifying the zIndex of the dialogs and the map to force
the dialogs to appear on top.  I am unable to get the dialogs to be in
front.

Any ideas on how to get the dialogs on top?

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: RPC error with Map

2008-10-31 Thread WebDude

Sounds like famous last words to me.  :)

things are working for me, despite the warning.  I have the following
suppress line in my gwt.xml file.


Out of curiosity more than anything, I would like to understand why
this error occurs.  I've read issue 2862 (http://code.google.com/p/
google-web-toolkit/issues/detail?id=2862), but I don't quite follow.

How come all of the other maps go through fine.  String by themselves
go through.  Collections of Strings go through.  Why doesn't a Map
with Strings as the values go through?  I don't even have to put
anything into the map.

Thanks


On Oct 31, 5:06 am, walden <[EMAIL PROTECTED]> wrote:
> WebDude,
>
> It's only a warning.  It will not prevent your application from
> running correctly, as far as I can tell so far.
>
> Walden
>
> On Oct 31, 8:04 am, walden <[EMAIL PROTECTED]> wrote:
>
> > Ian,
>
> > I'm confused by your statement "coming from server-side code".  That's
> > a compile warning against a serializable (shared) class.  I have a
> > similar artifact in my project right now.  It happens to be caused by
> > a defined type X that extends HashMap.  It seems as if
> > the compiler is inspecting the OrderedConstantSet, something never
> > referenced in the application, only because it is also a
> > Map.  I would like to understand if this is necessary
> > or a bug in the compiler.
>
> > Thanks,
>
> > Walden
>
> > On Oct 31, 7:10 am, "Ian Petersen" <[EMAIL PROTECTED]> wrote:
>
> > > On Thu, Oct 30, 2008 at 4:38 PM, WebDude <[EMAIL PROTECTED]> wrote:
> > > > If I leave out the "stringMap" member, I do not get the warning.  Is
> > > > this a warning I need to worry about?
>
> > > The warning is coming from your server-side code, not the definition
> > > of your transfer object.  Can you show us what you're sending back to
> > > the client?  What kind of instance are you putting in stringMap?
>
> > > Ian- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



RPC error with Map

2008-10-30 Thread WebDude

I have the following class which I'm passing to and from an RPC
method.  I receive this warning when I do:
[WARN] Field 'private final
com.google.gwt.i18n.client.impl.ConstantMap.OrderedConstantSet
keys' will not be serialized because it is final

If I leave out the "stringMap" member, I do not get the warning.  Is
this a warning I need to worry about?


public class GenericRPCObject implements IsSerializable
{
  public String strObj;
  public Map dateMap   = new
HashMap();
  public Map   stringMap = new
HashMap();
  public Map  intMap = new
HashMap();
  public Map  doubleMap   = new
HashMap();
  public Map objMap= new
HashMap();
}
--~--~-~--~~~---~--~~
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: Gwt + Openlayers + Beyond (but no so far)

2008-10-09 Thread WebDude

Try one of these modules:
http://sourceforge.net/projects/gwt-openlayers/
http://www.peterfranza.com/projects/gwt-openlayers-bindings/

Let us know which you find best (Neither seem to have great
documentation).

On Sep 13, 10:44 am, Javier Mena <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to useOpenLayersin Gwt, but I don't know to make
> something. I want that everytime a user press a button, the
> application create new panel a put a map there.
>
> I don't know how to do it even in JS.
>
> Currently my approach is somthing like this:
>
> public class X {
>   public onClick() {
>     Label x = new Label();
>     x.getElement().setId("mymap");
>     panel.add(x);
>     MyJsHelp.createMap("mymap");
>   }
>
> }
>
> public class MyJsHelp {
>   public native void MyJsHelp(String s) /*-{
>     var map = new $wnd.OpenLayers.Map("mymap");
>     
>   }-*/
>
> }
>
> The problem is that this code doesn't work, and I think it's because
> Gwt is not creating the label before createMap is called.
>
> If I execute the line:
>        MyJsHelp.createMap("mymap");
>
> In another event, and after creating the div, the code works.
>
> Any ideas? Adding a listener to draw after rendering? Force Gwt to
> create the label before createMap is called?
>
> Thanks in advance,
--~--~-~--~~~---~--~~
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: GWT and openlayers : ERROR

2008-10-09 Thread WebDude

A more detailed answer is here:
https://sourceforge.net/tracker/index.php?func=detail&aid=2035864&group_id=205333&atid=993218

To make to fix yourself, you'll need to get the source for GWT-
OpenLayers.  How to do that is described here:
http://sourceforge.net/cvs/?group_id=205333

If you're using Eclipse, you can do an "Import" and  select the "CVS-
>Projects from CVS" option.  Enter the information found in the link
above.  Then, all you have to do is add the protected constructor to
the JSObject class as described in the first link above, and create a
new jar.

I've send a request for a new release to be created.  I'm not sure
when that will happen though.

Hope that is a little more clear?


On Oct 9, 1:41 am, dzizes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm having the same problem, but I'm not sure how to follow your
> suggestions.
> Could you please be more specific.
>
> Greets,
> dzizes
>
> On 30 Wrz, 21:25, WebDude <[EMAIL PROTECTED]> wrote:
>
> > I had the same problem.  I think it was introduced with GWT 1.5.  I
> > had to download the OpenLayers source and add an empty protected
> > constructor to the JSObject class:
> > protected JSObject() {}
>
> > Everything seems to work fine after that.
>
> > --
> > Curtis
>
> > On Sep 15, 3:36 am, mazi <[EMAIL PROTECTED]> wrote:
>
> > > Dear all,
> > > I have recently tried running theopenlayersGWT plugin
> > > "openlayers_gwt-0.2.jar" along with "OpenLayers-2.6" in an example in
> > > eclipse. I have installed J2SE1.6 and ECLIPSE 3.4.
> > > I get the following error when I try to run the example in ECLIPSE.
> > > Anyone familiar with theopenlayersand GWT?
> > > I would appreciate any input on this one. I may have used the
> > > "openlayers_gwt-0.2.jar" instead of "openlayers_gwt-0.1.jar" in this
> > > particular case, could this be the problem?
> > > Thank you in advance and regards.
>
> > > [TRACE] Compiling Java source files in module 'tutorial.Tutorial1'
> > > [TRACE] Removing units with errors
> > > [ERROR] Errors in 'jar:file:/gwt-windows-1.5.2/gwt-windows-1.5.2/
> > > samples/gwt-openlayers-tutorial/openlayers_gwt-0.2.jar!/com/eg/gwt/openLaye
> > >  rs/client/JSObject.java'
> > > Line 5: Constructors must be 'protected' in subclasses of
> > > JavaScriptObject
> > >    More info: file:/gwt-windows-1.5.2/gwt-windows-1.5.2/doc/helpInfo/
> > > jsoRestrictions.html
> > > More info: file:/gwt-windows-1.5.2/gwt-windows-1.5.2/doc/helpInfo/
> > > jsoRestrictions.html
> > > Finding entry point classes
> > >    Unable to find type 'tutorial.client.Tutorial1'
> > >       Hint: Previous compiler errors may have made this type
> > > unavailable
> > >       Hint: Check the inheritance chain from your module; it may not
> > > be inheriting a required module or a module may not be adding its
> > > source path entries properly
--~--~-~--~~~---~--~~
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 Document to string (for displaying and saving)

2008-10-02 Thread WebDude

I have an XML Document object on the client side that the user would
like displayed and/or saved to disk (in proper XML formatting).

I'm having trouble figuring out how to convert a whole Document object
to an XML string.  How might I go about getting an XML string from a
Document object?  I've searched the group and it looks like this isn't
natively supported?

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: GWT OpenLayers map is null error

2008-09-30 Thread WebDude

Ah yes, that is it.  How silly of me.
Thanks.

On Sep 30, 1:13 pm, "Eric Ayers" <[EMAIL PROTECTED]> wrote:
> My guess is that the openlayers script isn't loaded into your browser.  You
> can verify this using firebug in firefox.
>
>
>
> On Tue, Sep 30, 2008 at 3:50 PM, WebDude <[EMAIL PROTECTED]> wrote:
>
> > Following the example here:
> >http://openlayers.org/pipermail/users/2007-September/002797.html
>
> > I get this error:
> > [ERROR] Unable to load module entry point class  (see associated
> > exception for details)
> > com.google.gwt.core.client.JavaScriptException: (TypeError):
> > '$wnd.OpenLayers.Map' is null or not an object
> > number: -2146823281
> > description: '$wnd.OpenLayers.Map' is null or not an object
> > at com.eg.gwt.openLayers.client.MapImpl.create(Native Method)
> > at com.eg.gwt.openLayers.client.Map.(Map.java:23)
> > at com.eg.gwt.openLayers.client.MapWidget.getMap(MapWidget.java:55)
>
> > This is on GWT 1.5 and, after I corrected for the JSObject protected
> > constructor error. I have gotten GWT OpenLayers to work under another
> > project in GWT 1.5. For some reason this project is giving me grief.
>
> > Any ideas why I'm getting this error?
>
> > Thanks,
> > Curtis
>
> --
> Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://code.google.com/webtoolkit/
--~--~-~--~~~---~--~~
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 OpenLayers map is null error

2008-09-30 Thread WebDude

Following the example here:
http://openlayers.org/pipermail/users/2007-September/002797.html

I get this error:
[ERROR] Unable to load module entry point class  (see associated
exception for details)
com.google.gwt.core.client.JavaScriptException: (TypeError):
'$wnd.OpenLayers.Map' is null or not an object
number: -2146823281
description: '$wnd.OpenLayers.Map' is null or not an object
at com.eg.gwt.openLayers.client.MapImpl.create(Native Method)
at com.eg.gwt.openLayers.client.Map.(Map.java:23)
at com.eg.gwt.openLayers.client.MapWidget.getMap(MapWidget.java:55)

This is on GWT 1.5 and, after I corrected for the JSObject protected
constructor error. I have gotten GWT OpenLayers to work under another
project in GWT 1.5. For some reason this project is giving me grief.

Any ideas why I'm getting this error?

Thanks,
Curtis
--~--~-~--~~~---~--~~
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: GWT and openlayers : ERROR

2008-09-30 Thread WebDude

I had the same problem.  I think it was introduced with GWT 1.5.  I
had to download the OpenLayers source and add an empty protected
constructor to the JSObject class:
protected JSObject() {}

Everything seems to work fine after that.

--
Curtis


On Sep 15, 3:36 am, mazi <[EMAIL PROTECTED]> wrote:
> Dear all,
> I have recently tried running theopenlayersGWT plugin
> "openlayers_gwt-0.2.jar" along with "OpenLayers-2.6" in an example in
> eclipse. I have installed J2SE1.6 and ECLIPSE 3.4.
> I get the following error when I try to run the example in ECLIPSE.
> Anyone familiar with theopenlayersand GWT?
> I would appreciate any input on this one. I may have used the
> "openlayers_gwt-0.2.jar" instead of "openlayers_gwt-0.1.jar" in this
> particular case, could this be the problem?
> Thank you in advance and regards.
>
> [TRACE] Compiling Java source files in module 'tutorial.Tutorial1'
> [TRACE] Removing units with errors
> [ERROR] Errors in 'jar:file:/gwt-windows-1.5.2/gwt-windows-1.5.2/
> samples/gwt-openlayers-tutorial/openlayers_gwt-0.2.jar!/com/eg/gwt/openLayers/client/JSObject.java'
> Line 5: Constructors must be 'protected' in subclasses of
> JavaScriptObject
>    More info: file:/gwt-windows-1.5.2/gwt-windows-1.5.2/doc/helpInfo/
> jsoRestrictions.html
> More info: file:/gwt-windows-1.5.2/gwt-windows-1.5.2/doc/helpInfo/
> jsoRestrictions.html
> Finding entry point classes
>    Unable to find type 'tutorial.client.Tutorial1'
>       Hint: Previous compiler errors may have made this type
> unavailable
>       Hint: Check the inheritance chain from your module; it may not
> be inheriting a required module or a module may not be adding its
> source path entries properly

--~--~-~--~~~---~--~~
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: Getting User Input from Input Field

2008-09-17 Thread WebDude

I tried "elem.getAttribute("value")".  It unfortunately, didn't change
the behavior.

As for using a text box, this example is a dumbed down version of what
I'm doing.  The real application is integrating GWT as part of other
(non-GWT) JavaScripts.  The other JavaScripts are inserting data into
an input field.  I would like to read those values from the GWT part
of the application. If there is a better way, I'm open to
suggestions.  I merely added the HTML element to better simulate the
situation I'm in.  I guess the sample code isn't a good example.  I
don't have a direct access to the Element object.  I would have to get
element by ID (the commented out lines in my example).

I guess, the real question is how do I get non-GWT javascripts to talk
to GWT?
I'm also curious to why it works in IE and hosted mode but not other
browsers.  I thought GWT was (thankfully) suppose to take care of
browser differences.

Thanks


On Sep 16, 7:08 am, "Danny Schimke" <[EMAIL PROTECTED]> wrote:
> You init an element with "com.google.gwt.user.client.Element elem
> = DOM.getChild(inputHTML.getElement(), 0);" and then you wanted to get the
> value "val = DOM.getElementAttribute(elem, "value");". Why you do not try to
> get the value by "elem.getAttribute("value")"? Or use a TextBox instead
> HTML("... your textbox as html- code ...") and work with getter- method(s)
> to get the value from outside. When I have enougth time I'll try your code:
> first and foremost, it looks really good... ;) See U L8er

--~--~-~--~~~---~--~~
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: Getting User Input from Input Field

2008-09-17 Thread WebDude

Thanks.  getElementProperty is what I needed.

The input was created this way to better show the situation.  The GWT
components are part of a web page that has other (non-GWT) JavaScripts
running in it.  The other JavaScripts are writting to an input field.
The user can also enter data in these fields.  I was trying to get the
GWT scripts to read this data.

Thanks again.


On Sep 16, 8:21 am, Thomas Broyer <[EMAIL PROTECTED]> wrote:
> On 15 sep, 22:20, WebDude <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to get the text entered by a user in an "input" field.  It
> > works in IE and in Hosted Mode, but not in Firefox or Chrome.  I'm
> > using DOM.getElementAttribute to read the text.  When it doesn't work,
> > all I get is an empty string.  I've made simple test case by modifying
> > the template code generated by the applicationCreator.  Below are the
> > code snippets.  Any ideas on how to get this to work?
>
> You obviously want to value *property*, not the value *attribute* (in
> IE, getAttribute(attrName) returns the DOM property)
>
> > final HTML inputHTML = new HTML(" > name=\"input1\">");
> > vPanel.add(inputHTML);
>
> Same remark as Danny... I guess you have your reasons for creating
> inputs this way.
>
> > button.addClickListener(new ClickListener() {
> >         public void onClick(Widget sender) {
> >                 String val = "NULL";
> >                 try
> >                 {
> >                         //com.google.gwt.user.client.Element elem =
> > DOM.getElementById("input1");
> >                         com.google.gwt.user.client.Element elem =
> > DOM.getChild(inputHTML.getElement(), 0);
> >                         if (elem != null)
> >                                 val = DOM.getElementAttribute(elem, 
> > "value");
>
> val = DOM.getElementProperty(elem, "value");

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



Getting User Input from Input Field

2008-09-16 Thread WebDude

I'm trying to get the text entered by a user in an "input" field.  It
works in IE and in Hosted Mode, but not in Firefox or Chrome.  I'm
using DOM.getElementAttribute to read the text.  When it doesn't work,
all I get is an empty string.  I've made simple test case by modifying
the template code generated by the applicationCreator.  Below are the
code snippets.  Any ideas on how to get this to work?


.
.
.
final HTML inputHTML = new HTML("");
vPanel.add(inputHTML);
.
.
.
button.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
String val = "NULL";
try
{
//com.google.gwt.user.client.Element elem =
DOM.getElementById("input1");
com.google.gwt.user.client.Element elem =
DOM.getChild(inputHTML.getElement(), 0);
if (elem != null)
val = DOM.getElementAttribute(elem, "value");
}
catch (Exception ex)
{
val = "ERROR: " + ex.getMessage();
}

  vPanel.add(new HTML("VALUE: " + val));
  }
});
.
.
.

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