The insertFirst method on the DOM model will also fail to register / 
unregister any event listeners.

To insert a Widget at the beginning of any ComplexPanel (such as RootPanel) 
use:

panel.insert(widget, 0);

If all you want to do is modify the DOM structure:

DivElement div = Document.createDivElement();
div.setInnerText("myDiv");
Document.get().getElementById("entries").insertFirst(div);

Hope this helps a bit.
// Jason

On Tuesday, 15 December 2009 01:08:17 Dennis Madsen wrote:
> Thanks for your reply!
> I cannot find a way to implement what do write. I'm doing something
> like:
> 
>               HTML widget = new HTML("<div class='entry'>myDiv</div>");
>               RootPanel.get("entries").getElement().insertFirst(widget);
> 
> But the insertFirst takes a node instead of a HTML widget. Any
> suggestions?
> 
> On 14 Dec., 18:44, Nicanor Cristian <[email protected]> wrote:
> > That's not necessary.
> > Suppose you want to insert an newWidget before the element "widget1".
> > All you have to do is:
> > widget1.getParent().getElement().insertBefore(newWidget,
> > widget1.getElement());
> >
> > On 12/14/2009 06:14 PM, Dennis Madsen wrote:
> > > I new to GWT - that's why! :)
> > > Could you like me to a tutorial/sample about these custom widgets?
> > >
> > > On 14 Dec., 18:06, Arthur Kalmenson<[email protected]>  wrote:
> > >> Oh, why not just create a custom widget to display entries by date?
> > >>
> > >> --
> > >> Arthur Kalmenson
> > >>
> > >> On Mon, Dec 14, 2009 at 12:04 PM, Dennis Madsen<[email protected]> 
 wrote:
> > >>> I'm doing some kind of guestbook which automatic async receive new
> > >>> guestbook entries. As the newest entry has to be on the top, is why I
> > >>> would like to prepend instead of adding/append.
> > >>> Since I'm receiving a lot of entries, it is not a solution to
> > >>> manually create a div in the markup for each of them.
> > >>>
> > >>> Hope you understand!
> > >>>
> > >>> On 14 Dec., 17:55, Arthur Kalmenson<[email protected]>  wrote:
> > >>>> You could just add another div before the entries and add to that
> > >>>> div.
> > >>>>
> > >>>> --
> > >>>> Arthur Kalmenson
> > >>>>
> > >>>> On Mon, Dec 14, 2009 at 11:38 AM, Dennis Madsen<[email protected]> 
 wrote:
> > >>>>> I'm adding a label into a div on my HTML:
> > >>>>> RootPanel.get("entries").add(myLabel);
> > >>>>>
> > >>>>> But what if I would like to prepend the label instead of adding it?
> > >>>>> How can I do so?
> > >>>>>
> > >>>>> --
> > >>>>>
> > >>>>> 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
> > >>>>> athttp://groups.google.com/group/google-web-toolkit?hl=en.
> > >>>
> > >>> --
> > >>>
> > >>> 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
> > >>> athttp://groups.google.com/group/google-web-toolkit?hl=en.
> > >
> > > --
> > >
> > > 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
> > > athttp://groups.google.com/group/google-web-toolkit?hl=en.
> 
> --
> 
> 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.
> 

--

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