In the previous article, we successfully integrated a custom-made tooltip over our hyperlinks. In this article, we’ll integrate an already existing tooltip library.
Since we already played with Twitter Bootstrap library, we’ll try to reuse their code.
If you follow this site regularly, we already used the Bootstrap library, or more exactly the GWT porting of the library in the Using GWT widgets serie. This time, we’ll use the library directly, without any third-party GWT wrapper.
The process mirrors what we already did when creating custom HTML code.
- Next, we have to provide the aforementioned local scripts. This is done by packaging them in the WAR as the previous class. So, if the extension was in the
com.morevaadin.vaadin7.html.jspackage, put the scripts in exactly the same one.
invokeCallback()function. This is the reason why we parameterized the
bootstrap_connector.jsscript previously (though you’re free to call it what you want).
The code itself depends on the particular library.
There are two important things to note:
- Nothing prevents you for providing multiple features in your server-side API since you can invoke whichever callback you want on the client side.
- In our case, we have access to the jQuery API since it was configured in the extension.
The code of this article can be found on GitHub.