How do I request client geolocation in Vaadin 8 application? - vaadin

Tried embedding this JS code into the UI: https://www.w3schools.com/html/html5_geolocation.asp but nothing happens.
Is there any way to achieve this in a Vaadin 8 app?

There couple of approaches to do this in Vaadin 8. In both cases you need to create custom component with client side part. The component can be based on GWT or be JavaScript component. In case of GWT based component, you need to use native JavaScript blocks. There is good example of that here in this GitHub repository:
https://github.com/heruan/vaadin-geolocation/blob/master/geolocation-addon/src/main/java/com/vaadin/addon/geolocation/client/GeolocationConnector.java
The above implementation has been released as an GeoLocation add-on in Vaadin Directory. So you do not need to re-invent the wheel, if you do not want to.

Related

How can I use Vaadin with SparkJava

I have implemented an API that is REST based using SparkJava (http://sparkjava.com). Its a standalone app and works great.
Now I'd like to implement part of that functionality access through a Vaadin UI. I'm quite new to Vaadin as well.
Does anyone know how I can still keep the single VM model, and able to use Vaadin's wonderful UI structures with greatness of SparkJava?
Is there someway that I can bind the Vaadin Servlet to the SparkJava Route perhaps?? Just thinking loud here.
Appreciate your help very much!!
I assume this is possible because I saw its used with Jetty (Vaadin 10/11 and embedded Jetty)
sure that is possible! You can simply make Jetty expose both SparkJava filter, and Vaadin 10+ servlet. I've created an example application which builds on Alejandro's work: https://github.com/mvysny/embedded-jetty-demo

Meteor + jQuery Mobile + Phonegap

How to connect jQuery Mobile (meteor add ...)? I understand that you can connect by adding the head, but I do not want to.
I know about how to use Meteor + Phonegap, however, advise which option is better?
Outdated information:
jQuery-Mobile Meteor sample integration and/or integration guidelines
I created a new jQuery mobile (jqm) demo app at jqmdemo.meteor.com
because the "old" demo app (jqm.meteor.com) wasn't working as expected.
You can create a package in your local lib folder to use jqm in meteor (see source code on bitbucket, link is on the demo page).
There's no meteorite package for this at atmosphere yet (mrt add ...). I haven't created one, because I think there are still many things that can be improved in the demo (e.g. popups are not working in the demo).
Also event binding needs to be re-checked because I added the event to the rendered function of the templates with jQuery.on(...).
Attaching the jquery mobile events to the template.[yourtemplate].events({}) handler would be better, but I don't know how to do this.
I can not say anything to phonegap at the moment. Because I haven't tested it.
But at the moment I think that jqm and meteor is a bit slow in performance. If you have a look at the fontawesome-demo inside of the jqm demo you'll notice that it takes quite long to render the >300 icons. Maybe a server side rendering would be better, but I think that's not ready in meteor.

Which are the basic guidelines for using Delphi IntraWeb with Twitter Bootstrap?

I would like to use the Bootstrap Framework with Delphi's IntraWeb (I'm using XE2)? The idea is to have the server side logic done by Delphi, while using the nice controls that come with BootStrap?
What would be the basic components "Hello World" application for this configuration?
What would be the high-level approach for a more elaborate application, for example one with a Bootstrap nav component that has its tab contents populated by Delphi?
Is combining IntraWeb and Bootstrap an overkill? Would I would be better off with an Indy TIdHTTPServer + Bootstrap?
It does not have to be difficult to implement Boostrap with Intraweb, you just have to add the Js files in the ContentFiles property of the IWForm, you just have to take in mind you have to write the html for each component you use for BootStrap.
In http://www.codegearguru.com in the Movie #63 - Using jQuery Mobile with IntraWeb - CodeRage 6 Replay
They have explained how to develope the Fishfact demo using jQueryMobile, using the TIWTemplateProcessorHTML component and standard IW components, so it should no be difficult to adapt it for bootstrap.
Here is the link: http://codegearguru.com/video/063/jQueryMobileFishFacts.html
Althought, there have been a new component suite since last year implementing JQuery and jQuery mobile, you should take a loo at http://www.cgdevtools.com, I'm using them and let me tell it give you IW app a very nice view. AFAIK they are planning to generate a component suite for Bootstrap.
As far as the web-server is concerned, it should provide the necessary files when the client requests them to run bootstrap client-side: Bootstrap: File Structure
To populate the components (client-side), you'll have to create the server-side logic so it will enter the correct javascript that does so into the HTML of the pages.

Does wicket has any Drag and drop component

I have 5-6 containers which I want to drag and drop across the viewable window.
Not on it's own but there are several jquery integrations to provide this functionality.
There are two interesting Wicket integrations for such stuff:
wicket-dnd: https://github.com/svenmeier/wicket-dnd
wicket-select2: https://github.com/ivaynberg/wicket-select2
I use both and am pleased with them, they both work with Wicket 6 and the Wicket jquery integration.
Yes, Wicket has such functionality in its wicket-ajax.js. It is being used by wicket-ajax-debug.js - the code used by the floating Ajax Debug window that you can see in DEVELOPMENT mode. But I also recommend to use the DnD functionality provided by the JavaScript library that use eventually use in your project.

Is there a dojo or a Jquery just for Firefox add on development?

Started working on Firefox add ons, which is done with JavaScript and XUL, and I find myself sorely wanting to use Dojo or someother kind of JavaScript like library, but I can't find one that exists. So I was thinking of starting a library by porting Dojo over to a Firefox add on specific fork. Get rid off the cross browser stuff, use array comprehension and other nice stuff available in Firefox's JavaScript engine. I worry about whether or not there's enough of a userbase who'd take advantage of this, but more than that I guess I'm wondering if there's already something like this? Google finds nothing.
Mozilla Corp developed a JavaScript library for this purpose: FUEL.
it is developed by John Resig the creator of jQuery.
To know how to use jQuery inside FF extension look at this similar question
jQuery, at least, functions perfectly well when embedded in a Firefox addon. I can't quote you names, but I've heard that several popular addons are already using jQuery.
Here's an article discussing using jQuery within XUL and some of the hoops you may need to jump through.
It is fairly common to embed jQuery in firefox extensions.

Resources