vaadin7

Validation icon not shown in Table fields

痞子三分冷 提交于 2019-12-10 19:49:07
问题 When I enter edit mode of my Table, I want the data validation exclamation mark icon (!) to be shown as soon as the user goes out of bounds of any of the validation constraints. First, a couple of notes: I'm using Vaadin 7, so the Bean Validation addon sadly won't work. The data validation works as intended. Now, I have a perfectly working table for which I am using a BeanItemContainer to keep my Person beans inside. The code for the table and the TableFieldFactory looks something like this:

Error during Table cache update in vaadin

佐手、 提交于 2019-12-10 19:38:45
问题 MY code is: BeanItemContainer<TimeCardBean> results = new BeanItemContainer<TimeCardBean> (TimeCardBean.class); for (TimeCardBean bean : beans) { results.addBean(bean); } table.setContainerDataSource(results); table.addGeneratedColumn("function",new ColumnGenerator(){ public Object generateCell(final Table source, final Object itemId, final Object columnId) { Byte timecardSeq= (Byte)source.addItem(itemId).getItemProperty("timeCardSeq").getValue(); Button btnChange= new Button("Change", new

Getting a NoClassDefFoundError after installing Vaadin

南笙酒味 提交于 2019-12-10 08:58:22
问题 I want to do a project using Vaadin and am facing some issues. Here's what I did. I downloaded Eclipse and installed the Vaadin for Eclipse plugin. Then, I created a new Vaadin 7 project. It downloaded some Ivy dependencies but then, when I pressed Run, I get this error: java.lang.NoClassDefFoundError:com/vaadin/server/VaadinServlet. I searched a bit on the Internet but to no avail. One thing is that in the web-app's WEB-INF/lib folder, there are no jars. I have attached a screenshot of the

How to make only some columns editable in a Vaadin Grid?

China☆狼群 提交于 2019-12-10 04:13:23
问题 Vaadin Grid allows to be defined as editable with grid.setEditorEnabled(true); This makes all visible columns editable. However I don't want the user to edit an specific column, but seems like the editable is an all or nothing. The next best solution I have found is to define an editor field with a disabled editor, which almost does the trick but the user is still able to select the text and move the cursor (but the field is not editable anymore). Grid.Column nameColumn = grid.getColumn(

How to get the Vaadin 7 application server IP and port?

佐手、 提交于 2019-12-10 02:39:17
问题 How can I get the protocol, IP and port of the app server running my Vaadin webapp? I'm using Vaadin 7. In vaadin 6 I doing in this way, but not work in vaadin 7: String server = ((WebApplicationContext) this.getContext()).getHttpSession().getServletContext().getServerInfo(); java.net.URL url = this.getURL(); String s = url.getHost()+":"+url.getPort()+url.getPath(); 回答1: System.out.println(UI.getCurrent().getPage().getLocation().getHost()); System.out.println(UI.getCurrent().getPage()

Vaadin : how to get return value from javascript methods?

你说的曾经没有我的故事 提交于 2019-12-08 19:40:30
I have one JS method showMessage(message) function showMessage(message) { alert(message); return "Your message is " + message; } I can get arguments of method from my component or UI as JavaScript.getCurrent().addFunction("showMessage", new JavaScriptFunction() { @Override public void call(final JSONArray arguments) throws JSONException { System.out.println("Getting call JS method " + arguments); } }); Page.getCurrent().getJavaScript().execute("showMessage(Hello World !)"); So , has there anyway to get return values of JS methods in Vaadin ? If yes , how can I figure it out ? no you can't

Vaadin : how to get return value from javascript methods?

徘徊边缘 提交于 2019-12-08 06:49:22
问题 I have one JS method showMessage(message) function showMessage(message) { alert(message); return "Your message is " + message; } I can get arguments of method from my component or UI as JavaScript.getCurrent().addFunction("showMessage", new JavaScriptFunction() { @Override public void call(final JSONArray arguments) throws JSONException { System.out.println("Getting call JS method " + arguments); } }); Page.getCurrent().getJavaScript().execute("showMessage(Hello World !)"); So , has there

Vaadin Custom Components/Widgets with Maven and Spring Boot

99封情书 提交于 2019-12-08 02:58:11
问题 I am relatively new to vaadin and started out with a spring boot application and the vaadin spring boot plugin. Everything worked fine until I got to the point where I tried to create my own components/widgets. Unfortunately I didn't find any "official" example/documentation how to set up custom components within a spring boot application so I had to search the web to find out how to set up additional plugin(s) in maven to compile the code for the client side widgets. As far as I can tell

Need locking when call VaadinSession getAttribute in Vaadin 7

痞子三分冷 提交于 2019-12-07 15:54:03
问题 I know that it is necessary when call setAttribute (link), but what about getAttirbute? Is this correct? public Object getMyAttribute() { return VaadinSession.getCurrent().getAttribute("myAttribute"); } Or need locking? public Object getMyAttribute() { try { VaadinSession.getCurrent().getLockInstance().lock(); return VaadinSession.getCurrent().getAttribute("myAttribute"); } finally { VaadinSession.getCurrent().getLockInstance().unlock(); } } 回答1: Adding to the answer by Patton. While I'm not

Vaadin Grid row height

允我心安 提交于 2019-12-07 13:56:12
问题 I want to reduce cell size so to fit more rows in screen. [screen][1] so far i have used .v-grid-cell { font-size: 13px; height: 18px; vertical-align: middle; } .v-grid-row{ height: 18px; } .v-grid-row-odd { height: 18px; background-color: #EFF0F1; } and the [result][2] 回答1: Try setting a line-height on .v-grid-cell : .v-grid-cell { line-height: 18px; } This isn't really a Sass question though, it's just general plain 'ol CSS. 回答2: try to reduce the font size of the grid. Try like below. .v