Add LIElement to UListElement and HyperLink to LIElement programmatically?

43 views
Skip to first unread message

Slava Imeshev

unread,
Jul 25, 2021, 11:30:52 AM7/25/21
to GWT Users

Hi all,

What's the correct way to add LIElement to UListElement and HyperLink to LIElement programmatically?

I'm building a breadcrumb using UL.

Slava

Jens

unread,
Jul 29, 2021, 6:05:15 AM7/29/21
to GWT Users
Hi,

take a look at com.google.gwt.dom.client.Document class. It has methods for creating elements and then you can just stitch them together using Element.appendChild() method.

If you want to abstract the logic a bit and/or you need it as Widget you could write your own BreadCrumbWidget extends Widget and then use the Document class internally to build the DOM structure as needed.

-- J.

Reply all
Reply to author
Forward
0 new messages