How to replace element with my GWT widget?

后端 未结 5 464
慢半拍i
慢半拍i 2021-02-02 01:46

Is it possible to replace known html element with my widget component? (Emphasis on the word \'replace\', I don\'t want to put the widget in th

5条回答
  •  无人共我
    2021-02-02 02:29

    I'm doing something pretty similar. I'm reading the contents of a

    ; using the elements found in the
    to build an animated menu which then replaces the original content. The animated menu is a widget.

    It seems to work...

    // DisclosurePanel is a widget
    DisclosurePanel accordion_panel = processAccordion(accordionElement);
    // accordionElement is found in the DOM (it's a com.google.gwt.user.client.Element)
    // clear what was there
    accordionElement.setInnerText("");
    // add the widget in
    RootPanel.get(accordionElement.getId()).add(accordion_panel);
    

提交回复
热议问题