Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7801689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:01:28+00:00 2026-06-02T01:01:28+00:00

Is it possible to build stand alone widgets as opposed to full blown applications

  • 0

Is it possible to build stand alone widgets as opposed to full blown applications in GWT ? For example, I could use a create a slider widget as a jquery plugin and use it to add interactivity to my existing HTML page (which may be a JSF or JSF etc. generatd HTML) along side some other jquery based widgets from third parties on the same page ? Is this possible with GWT ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:01:29+00:00Added an answer on June 2, 2026 at 1:01 am

    Yes you can, and some of standard widgets have allready implemented static methods for attaching them without use of Rootpanel (so you can do “DOM programming”), for example look at HTML Widget. It has static method wrap for that purpose:

    public static HTML wrap(Element element) {
        // Assert that the element is attached.
        assert Document.get().getBody().isOrHasChild(element);
    
        HTML html = new HTML(element);
    
        // Mark it attached and remember it for cleanup.
        html.onAttach();
        RootPanel.detachOnWindowClose(html);
    
        return html;
    }
    

    so in your code you can use it for attaching widget to existing DOM elements:

    HTML html = HTML.wrap(Document.get().getBody().getFirstChildElement());
    
    //or using selector engine (maybe wrapped Sizzle?):
    HTML html = HTML.wrap(GSizzle.findOne("div.someClass:first"));
    

    you can make similar static method in your widget:

    class MyWidget extends Widget {
        public static MyWidget wrap(Element element) {
            MyWidget w = new MyWidget(element);
            w.onAttach();
            RootPanel.detachOnWindowClose(w);
            return w;
        }
    
        //Widget has protected constructor Widget(Element)
        //but it only creates widget but onAttach is called as Widget 
        //is added to Parent Widget-Panel
        protected MyWidget(Element e) {
            super(e);
        }
    
        //"plain" constructor for widget-panel-workflow
        public MyWidget() {
            super(Document.get().createDivElement());
        }
    }
    

    but crucial is to call widgets protected method onAttach before attaching to dom – it subscribes the widget to global dom event broadcaster, and call RootPanel.detachOnWindowClose on your widget to prevent memory leaks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would it be possible to build and deploy Meteor applications on Google App Engine
Is it possible to use Phonegap's Build service to build projects that may have
I want to build application which servers as a stand-alone system service, always run
Is it possible to build an iOS app that will get user's voicemails ?
is it possible to build a jar file made up of all jar files
I'm searching if it's possible to build the same Linux Kerneltwice (same sources, same
If I have 6 modules in my project is it possible to build only
I am curious if it is possible to dynamically build a list comprehension in
Is it possible to cancel/abort a running build process in Visual Studio 2008? How?
Is it possible for me to build my own version of android and put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.