Hi Gert, I tried with the "wrap" method and it works great :)
Thanks a lot ! Daniel On Jun 24, 9:10 am, gscholt <[email protected]> wrote: > On Jun 24, 12:26 am, Daniel Pascariu <[email protected]> > wrote: > > > > > Dear All, > > > I have the following problem: > > > I have a Java servlet which creates a dynamic table, each row > > containing a button that I want to use for the deletion of the row. > > I want to delete the rows in the table without broser refresh and > > since I have Java on the backend I thought it would be nice if I could > > use GWT RPC for that. > > I want to have my HTML page generated by the servlet and not by GWT > > (because I want it to be indexed by the serach engines) - the only > > dynamic functionality would be for the delete buttons. > > > I tried to create dynamic root panels for all my rows (buttons) in the > > table, but I couldn't get it running - all the examples I have seen > > are for predefined root panels (the standard "slot1" and "slot2"). > > > Would it be possible to have something like this: > > - get all root panels where the html element id is like <"slot" + > > number> ? > > (Then I'd be able to create a button for each root panel) > > Of course :) > If you just make sure the prefix ("slot") is unique, and the slots are > generated sequentially with no gaps; this would do: > int i = 0; > RootPanel p; > while ((p = RootPanel.get("slot" + i)) != null) { > doSomethingWith(p); > } > Though, if your example is as simple as just being buttons, this: > int i = 0; > Element e; > while ((e = Document.get().getElementById("deleteButton" + i)) != > null) { > Button b = Button.wrap(e); > doSomethingWith(b); > } > Would save you from creating all the rootpanels, if the server has > generated the buttons already. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
