Vaadin Tutorial
Vaadin Tutorial
Vaadin Tutorial
Vaadin framework provides features that lets you to develop web content without using
HTML, XML etc. Thus, using Vaadin you can create your front end as well as back end
using JAVA as a programming language.
This tutorial gives you a basic coverage of concepts of Vaadin and makes you comfortable
to use it in your software development projects.
Audience
This tutorial will help beginners to understand Vaadin from scratch. After completing this
tutorial, you will gain a moderate level of expertise in Vaadin, which helps you to move to
further levels.
Prerequisites
Before you start with this tutorial, we assume that you have a basic understanding of Java
programming language. Besides, knowledge on any programming environment and basic
concepts such as variables, commands, syntax, etc. will be beneficial. We strongly
recommend that you refer to JAVA programming language tutorials before proceed further
with Vaadin.
All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent
of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our
website or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at contact@tutorialspoint.com
i
Vaadin
Table of Contents
About the Tutorial ..................................................................................................................................... i
Audience .................................................................................................................................................... i
Prerequisites .............................................................................................................................................. i
4. VAADIN – ARCHITECTURE................................................................................................... 11
Label ....................................................................................................................................................... 13
Link ......................................................................................................................................................... 16
Button..................................................................................................................................................... 22
Table ....................................................................................................................................................... 29
Tree ........................................................................................................................................................ 30
ii
Vaadin
Combo BOX............................................................................................................................................. 35
Upload .................................................................................................................................................... 46
ICON ....................................................................................................................................................... 47
Grid ......................................................................................................................................................... 52
Panel ....................................................................................................................................................... 57
Tab-Sheet................................................................................................................................................ 61
Built In Theme......................................................................................................................................... 67
iii
1. Vaadin – Overview
This chapter will provide an overview of Vaadin. You will also be able to list out the merits
and demerits of working with Vaadin, once you are done with this chapter.
What is Vaadin?
Vaadin is an open source web development framework. It comes with an inbuilt support
for Java scripts and AJAX. You can also include external features into it using Google Web
toolkit. Vaadin is a time-saver for the developers as it renders a rich content in the browser
without the help of any markup files. All mark ups and supporting files will be generated
at runtime with the help of Vaadin framework. Vaadin uses Java as a programming
language and it supports both server side and client side development.
Advantages
Vaadin offers the following advantages to its developers:
1
Vaadin
Disadvantages
Vaadin offers the following disadvantages to its developers:
Scalability
Some experts feel that Vaadin cannot compete with the other thin client based
technologies such as Angular.js. Hence Vaadin is less scalable than other available
technologies.
2
2. Vaadin – Environment Setup Vaadin
In this chapter we will learn how to set up the local environment to develop a Vaadin
application.
Netbean https://netbeans.org/downloads/
Eclipse https://www.eclipse.org/downloads/
Intellij https://www.jetbrains.com/idea/download/#section=windows
Whichever IDE you use, make sure that you use the latest version. Please note that we
are using Eclipse IDE in this tutorial.
3
Vaadin
This step might take some time as Eclipse needs to download all related files and install
the same and configure it with the recent IDE. After successful installation, Eclipse will
prompt you for a quick restart as the new change will reflect only after you restart the
same. Once you restart, your local system is ready for using Vaadin application.
4
3. Vaadin – Creating First Application Vaadin
In the previous chapter, you have seen the installation of Vaadin on your local system. In
this chapter let us start by creating our first application using Vaadin. Recall that we are
using Eclipse IDE in this tutorial.
To start creating your first application in Vaadin, open Eclipse IDE in your local system and
follow the steps given below:
Step 1: On the File menu, Click New and then click Other. Refer to the following
screenshot for better understanding.
5
Vaadin
Step 2: Now, type Vaadin in the search box and you can see options as shown in the
following screenshot. Now, select Vaadin 8 from the options and click Next.
6
Vaadin
Step 3: You can see a window with four options as shown below. Select the first option
and proceed to the next step.
7
Vaadin
Step 4: Next, you can see a screen as shown in the screenshot below. Provide the Group
Id and Artifact Id and select Finish. This completes the project and Eclipse will create
Vaadin for you.
Please note that this step might take some time as it requires the configuration settings.
The artefact id is the name of the current project. We have named it as MyFirstApp.
8
Vaadin
Step 5: Now, you can find the directory structure of the automated Vaadin project as
shown below:
Step 6: Your first Vaadin application is ready. Run the project in any application server.
Once it is ready you can find your screen as shown below:
9
Vaadin
Step 7: Enter any text in the text box and click on the Click Me button. You can observe
the output as shown:
10
Vaadin
11