Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to wrap an existing div into an HTML widget ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joe  
View profile  
 More options Jan 30 2011, 7:16 am
From: Joe <joechahh...@gmail.com>
Date: Sun, 30 Jan 2011 04:16:57 -0800 (PST)
Local: Sun, Jan 30 2011 7:16 am
Subject: How to wrap an existing div into an HTML widget ?
Hi,

I wonder how to wrap an existing div into an HTML widget.

I am using GQuery to retrieve the element already attached to the html
page.

Now that I have a DOM div element, I use HTML myHtml =
HTML.wrap(element);

When i run the code i get the following error:

java.lang.AssertionError: A widget that has an existing parent widget
may not be added to the detach list
        at
com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:
136)
        at com.google.gwt.user.client.ui.HTML.wrap(HTML.java:66)

Any ideas, suggestions or help are welcome.

Thank's,

Joe


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe  
View profile  
 More options Jan 30 2011, 8:41 am
From: Joe <joechahh...@gmail.com>
Date: Sun, 30 Jan 2011 05:41:01 -0800 (PST)
Local: Sun, Jan 30 2011 8:41 am
Subject: Re: How to wrap an existing div into an HTML widget ?
It's working fine now.

My mistake was that somewhere on the page I was doing this action:

    RootPanel root = RootPanel.get("content");
    root.setStyleName("content_style");

so instead of doing this, I did:

Document.get().getElementById("content").removeClassName("content_style");

And now I am able to write

    HTML myHtml = HTML.wrap(element);  // element retrieved by GQuery.

So my problem is solved.

However, I cannot now add widgets to the element : <div id="content"></
div>
using root.add(new HTML());

Why is that? any workarounds ?

On Jan 30, 2:16 pm, Joe <joechahh...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »