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 6937587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:22:59+00:00 2026-05-27T12:22:59+00:00

I am trying to create a Bootstrap popover on a TextBox from GWT. <a

  • 0

I am trying to create a Bootstrap popover on a TextBox from GWT.

<a href="#" class="btn danger" rel="popover" title="A title" data-content="some content...">hover for popover</a>

<script>
  $(function () {
    $("a[rel=popover]").popover({
              offset: 10
    });
  })
</script>

like so:

TextBox tb1 = new TextBox();
DOM.setElementAttribute(tb1.getElement(), "rel", "popover");
DOM.setElementAttribute(tb1.getElement(), "title", "A Title");
DOM.setElementAttribute(tb1.getElement(), "data-content", "Popover content...");

and then, in the <head> of my .html the <script> part mentioned above (with $("input[rel=popover])...")).

The required .js-files are linked to the html file via <script src=...>

But nothing happens when i hover the TextBox.

Some questions:

Is this restricted to <a>? Or am I loading the script files wrong?
Is it even possible to add rel=... and data-content=... to a TextBox of GWT? Do I need jQuery/GQuery for that script snippet?

edit:

I tried what Strelok suggested and got the following error:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Thread.java:680)

Caused by: com.google.gwt.core.client.JavaScriptException: (ReferenceError): $ is not defined
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at de.eikecochu.awidb.client.Awidb.bindBootstrapPopover(Awidb.java)
at de.eikecochu.awidb.client.Awidb.onModuleLoad(Awidb.java:11)
... 9 more
  • 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-05-27T12:23:00+00:00Added an answer on May 27, 2026 at 12:23 pm

    I’ve been curious of integrating Bootstrap with GWT myself, but have not tried it. My guess is that if you are including bootstrap-twipsy.js and bootstrap-popover.js you also need to include jQuery on your page.

    In addition to that you most likely need to call $('xxx').popover(options) after your text box is attached in GWT. So try something like this:

    public void onModuleLoad() {
      final TextBox tb1 = new TextBox();
      DOM.setElementAttribute(tb1.getElement(), "rel", "popover");
      DOM.setElementAttribute(tb1.getElement(), "title", "A Title");
      DOM.setElementAttribute(tb1.getElement(), "data-content", "Popover content...");
      DOM.setElementAttribute(tb1.getElement(), "id", "test");
      tb1.addAttachHandler( new AttachEvent.Handler() {
        public void onAttach(AttachEvent e) {
          if (e.isAttached()) {
            bindBootstrapPopover(tb1.getElement().getId());
          }
        }
      });
      RootPanel.get().add(tb1);
    }
    
    native void bindBootstrapPopover(String id) /*-{
      $('#'+id).popover( {offset:10} );
    }-*/;
    

    Would be curious to hear how you go with this.

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

Sidebar

Related Questions

Trying to create a list to return some JSON data to a view. Following
I'm trying to create a topbar using twitter bootstrap, but the black bar won't
I'm trying create a simple bookmarklet to capture the title and url of a
I'm trying to create a JQuery Dropdown similar to the one used in bootstrap.
I'm trying create an immutable object and initialise it from xml config file in
I`m trying to create a small bootstrap in php. my dirs are like this:
I am trying to create a sort of bootstrap web service using a classic
I'm trying to create a mod rewrite expression to redirect from localhost/1234 to localhost/controller/action?param=1234.
I'm trying to create a login view with GWT Designer. I have the styles
I am trying create a WCF service that leverages the WPF MediaPlayer on the

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.