Thanks for the replies but I am not sure I can do much with those,
though I may not be looking at things the right way.
Let me try to explain a bit better (hopefully).
RootPanel.get(String id) returns you a RootPanel for the element with
the given id. That only works for certain "top level" elements.
So in the <ul> example below if I did this
<ul id="menu">
    ....
</ul>
and I do
RootPanel ul = RootPanel.get("menu");
I get back the <ul> block as a RootPanel.
However it does not appear there is anything I can do with it.
If I enumerate the children there are none. In other words the <li>
elements are not created in the "java universe".
I can reach the <li> nodes in the dom Element space but I am not sure
I can do much with them then (I need to hook up an event handlers at
the very least).

So overall the question is about what is doable with static HTML in
GWT. It's clear you can do everything with dynamic code. But if I have
a bunch of static HTML that I want to leverage where is the line? What
is that shows up in some form in the "java" object model (for lack of
a better word) and how much can be done with static HTML.

Thanks for the feedback


On Oct 11, 12:37 pm, Jim Douglas <[email protected]> wrote:
> Or look at this:
>
> http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/g...
>
> On Oct 11, 10:20 am, Jeff Chimene <[email protected]> wrote:
>
>
>
> > On 10/11/2010 09:30 AM, Il Lupo wrote:
>
> > > I have been searching around for this with no luck so I decided to
> > > post the question hoping to get a quick and straight answer.
> > > Is there a way to hook up GWT java methods/classes to straight HTML?
> > > I can see a way to do it with DIVs (retrieval via id) but cannot find
> > > a way to do it on other HTML tags.
> > > Example:
> > > say I have a menu implemented with CSS and the following HTML snippet
>
> > > ...
> > >     <ul>
> > >         <li><a href="...">One</a></li>
> > >         <li><a href="...">Two</a></li>
> > >         <li><a href="...">Three</a></li>
> > >     </ul>
> > > ...
> > > I want to run GWT code (some method in some java class) when the user
> > > clicks on one of the anchors.
> > > Is there a way to do it?
>
> > > Or as an alternative, if I define some <ul>/<li> gropus in an html
> > > file, is there a way to "surface" that in GWT? (by surface I mean a
> > > way to retrieve it with code and operate on it).
>
> > The first place to 
> > start:http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI...
>
> > then
>
> > > ...
> > >     <ul>
> > >         <li><a href="javascript:foo()">One</a></li>
> > >         <li><a href="javascript:bar()">Two</a></li>
> > >     </ul>
> > > ...

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

Reply via email to