编写Vaadin项目的有效方法是什么? [英] What's effective way to write Vaadin project ?

查看:166
本文介绍了编写Vaadin项目的有效方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在Vaadin中编写Java Web应用程序的有效方法。
(几页,很多表格,按钮..)

I'm looking for effective approach to writing Java web app in Vaadin. (several pages, a lot of tables, buttons..)

我应该从什么开始?

这是一个很好的解决方案,从编写所有需要的组件,布局,面板和下一个合并所有构建单个页面开始?

It's good solution to begin from writing all needed components, layouts, panels and next merge all that to build single pages ?

或者最好是在不考虑整个项目的情况下编写每一页(当然,除了更改页面),所以例如:首先我写入登录页面(以及我需要的所有东西),接下来我编写管理页面等..

or maybe it's better to write every single page with no thinking about the entire project (of course, except changing pages), so for example: first I write login page (and all stuff I need for it), next I write admin page etc..

问题涉及Vaadin,但知道它在其他Java Web框架中的样子也不错。

question concerns Vaadin, but it would be also fine to know, how it looks like in other Java web frameworks.

推荐答案

我最近刚进入Vaadin,这是我用来启动应用程序的方法。

I am recently just got into Vaadin and this is the method I used to get my app off the ground.

首先查看采样器应用程序,了解Vaadin的可能性:采样器

First off check out the sampler application to get an idea of what is possible with Vaadin: Sampler

如果您正在使用eclipse,请获取插件。使用Eclipse中的内置安装新软件功能(帮助 - >安装新软件),只需输入链接并安装插件: Eclipse插件

If you are using eclipse get the plug-in. Using the built-in "Install New software" function in Eclipse(Help -> Install new software) just type in the link and install the plugin: Eclipse Plugin

使用该插件创建一个基本的vaadin项目。右键单击Project explorer - > New - > Vaadin Project
然后浏览网站上的1小时教程版本教程

Use the plugin to create a basic vaadin project. Right-click in the Project explorer -> New -> Vaadin Project Then go through the "1-hour" tutorial version on the site Tutorial

它将逐步介绍如何创建应用程序,还将为您提供组织项目的基本结构。尽量多写自己,然后在遇到困难时查看示例。

It will take you step by step into how to create a application and also will give you a basic structure by which to organize your project. Try to write as much as you can yourself and then look at the examples when you get stuck.

布局简而言之:

在最简单的级别,您将拥有垂直布局。

At the most simple level you will have a vertical layout.

然后,您将为此布局添加面板。面板类似于div元素。为面板添加标题。使用verticalLayout.setSpacing(true)来区分布局中的元素。

Then you will add a panels to this layout. A panel is similar to a div element. Add captions to panels. Use verticalLayout.setSpacing(true) to space out the elements in a layout.

然后,您将向面板添加内容,例如用于显示数据或表单的表格或网格布局。内容中的元素(如表)可以链接到容器,该容器是元素的数据源。

Then you will add content to the panels such as a table for displaying data or a form or grid layout. Elements in the content such as a table can be linked to a container which is a datasource for a element.

基本方法:

创建:

布局(组织元素) - >要放置在布局中的元素 - >元素的侦听器(To处理像onClick这样的事件 - >用于与数据交互的元素的容器(用于处理持久性和数据填充)

Layout(To organize elements) -> Elements to be placed in layout -> listeners for elements(To handle events like onClick) -> containers for elements that interact with data(To handle persistence and data population)

我想说一页工作得很好然后扩展从那里。花更多的时间学习容器的工作方式。

I'd say get one page working fairly well then expand out from there. Spend extra time learning how containers work.

这篇关于编写Vaadin项目的有效方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆