Hi markww,
There isn't a way to instantiate a Java object directly from a <div>
element, but you can wrap the <div> in a Composite class that represents the
<div> and make associative changes be reflected through
DOM.getElementAttribute()/setElementAttribute().
Hope that helps,
-Sumit Chandel
On Fri, Dec 5, 2008 at 12:56 PM, markww <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have an existing html file, with a <div> definition like:
>
> <html>
> <div id="test" x="20px" y="100px" />
> </html>
>
> In my GWT project, is there a way to recover that <div> and use it as
> the "backing" for my javascript object? Say I define a class in my
> project:
>
> public class Test
> {
> int _tx;
> int _ty;
> }
>
> Is there a way to do something like this:
>
> public void onModuleLoad()
> {
> Test test = new Test(getElementById("test"));
> }
>
> so now anything I do to my "test" object is manipulating the <div>,
> and it somehow also added a _tx and _ty member property to the div
> instance as well?
>
> 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---