1 Reply Latest reply on Mar 26, 2013 11:38 AM by edewit

    Templates and UL - add a LI item

    magick93

      Hi

       

      As far as I know, GWT does not have a ListItem object.

       

      I'm trying to figure out how to add new LI items to a UL list.

       

      Can anyone advise?

       

      Br

        • 1. Re: Templates and UL - add a LI item
          edewit

          Hi Anton,

           

          Right now it's a bit hard, but it can be done, first bind the ul like so:

           

            @DataField

            Element list = Document.get().createElement("ul");

           

          Then in a method that is annotated with PostConstruct for instance you can add a li element

           

                Element li = Document.get().createElement("li");

                list.appendChild(li);

           

          Hope that that helps we are planning to improve this by creating our own widget that works together with org.jboss.errai.ui.client.widget.ListWidget #517

           

          Cheers,

               Erik Jan

          1 of 1 people found this helpful