I am kind of afcing similar issue.
I have AJAX call to server which returns my View definition in XML and
I apply XSL to transform it into HTML and I set HTML using innerHTML
which seems to be taking longer time.
document.getElementById("test").innerHTML = str; where str is
transformed HTML a big long string.
The performance of HTML varies anywhere between 100ms to 1200ms both
on IE 6 and 7.
any clues? any alternatives to thsi approach? I can't use DOM for
other reasons.
On Mar 10, 4:21 pm, "levi.bracken" <[email protected]> wrote:
> I guess I don't understand what you're trying to accomplish. So the
> div is already attached to the DOM of the host page, but at some point
> you're trying to pull that div into the GWT 'area' of the page? (When
> I say 'area' I mean the boundaries of whatever RootPanel element GWT
> is attaching itself to.) So is GWT doing any operations on the
> content of this div or are you just wrapping it in the GWT 'area' for
> layout / style purposes.
>
> If it's just for the latter, and you absolutely need this div to
> remain in the host page's markup, then maybe you should change how GWT
> attaches to the host page. Instead of all attaching in one spot you
> could break it up into multiple sections. For ex: Header, Left
> Nav, Content, Footer, etc each attaching to a separate RootPanel
> element. You still would have a single GWT entry point, but
> different parts get attached to different elements of the host page
> and can flow around your div so you don't have to pull it into GWT.
>
> If that isn't of any help then could you explain a bit more what this
> div in the DOM does and why you're trying to pull it into GWT.
>
> On Mar 10, 3:47 pm, wera <[email protected]> wrote:
>
>
>
> > I forgot to mention that the Div that I should wrap is already in DOM.
> > I get it this way:
> > Element myBigDiv = DOM.getElementById("myDiv");
>
> > On Mar 10, 9:44 pm, wera <[email protected]> wrote:
>
> > > Thanks
> > > I tried that, its like setting innerHTML. So it takes a lot time
>
> > > I saw that there is a function HTML.wrap(Element)
> > > But I didn't succeed to use it, I get an exception when I add the
> > > created component to DOM
>
> > > thank you
>
> > > On Mar 10, 9:20 pm, "levi.bracken" <[email protected]> wrote:
>
> > > > Have you tried just setting the text in the constructor of the HTML
> > > > widget or HTML Panel?
>
> > > > String customHtml = "<div>My Custom HTML...</div>";
> > > > HTML myDiv = new HTML(customHtml);
>
> > > > That should do the job unless your content is changing. It's
> > > > typically very fast. What kind of markup is in your html?
>
> > > > On Mar 10, 2:10 pm, wera <[email protected]> wrote:
>
> > > > > Hi all,
>
> > > > > I have an HTML div that should be moved to GWT component efficiently.
> > > > > What do you recommend?
>
> > > > > Before I was doing it by setting innerHTML in gwt HTML() component
> > > > > (http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/
> > > > > src/com/google/gwt/user/client/ui/HTML.java?r=3173)
>
> > > > > But it took too long to do it.
>
> > > > > thanks- 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 [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
-~----------~----~----~----~------~----~------~--~---