vaadin

Change themes in Vaadin 7 via code

China☆狼群 提交于 2019-12-09 06:02:52
问题 I am doing a project in Vaadin 7. In that I need to change the theme of a page. In Vaadin 6, there is a function called 'setTheme()'. so that I can change the theme using that function wherever I want in my code. But, In Vaadin 7, I couldn't find any like that. I know there will be a way to do it. And also how to apply changes on the UI when I change a theme? Will it be changed automatically? (or) ICEPush gonna help me? 回答1: In Vaadin 7 the method 'setTheme()' has been replaced with the new

Vaadin - Coloring table cells based on content

筅森魡賤 提交于 2019-12-09 04:44:36
问题 I have a very basic example here where I'm trying to color specific cells based on a specific string value being present in that cell. I put in print statements and I'm hitting the return "green", return "orange", etc... points, but at run time I'm only getting the gray and white alternating row colors, none of my specific cell colors. The css I'm using I pulled directly from book of vaadin, thought this would be straightforward. Maybe there's something small I'm missing. Cell style generator

Vaadin std prod project includes vaadin-client-compiler and jetty?

点点圈 提交于 2019-12-09 04:28:25
I get vaadin-client-compiler artifact (which brings Jetty with it) included with my production project. Am I supposed to ? To reproduce I'm starting from scratch and letting Maven generate a Vaadin multimodule project for me: mvn -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application-multimodule -DarchetypeVersion=7.6.2 -DarchetypeRepository=http://repo.maven.apache.org/maven2/ -DgroupId=com.acme -DartifactId=VaadinTest1 -Dversion=1.0.0-SNAPSHOT -Dpackage=com.acme.vaadintest1 -Dbasedir=D:\\dev\\java -DthemeName=mytheme -DwidgetsetName=MyAppWidgetset -DuiName=MyUI

How to get all sessions in Vaadin

混江龙づ霸主 提交于 2019-12-09 02:51:07
问题 I want to know How many users are connected to my application in real time. I got the idea to loop on number of session that are open but I can't find how to do that. If you have another way to do it your suggestions are welcome. 回答1: Best solution i found so far is to count the sessions when they are created and destroyed. public class VaadinSessionListener{ private static volatile int activeSessions = 0; public static class VaadinSessionInitListener implements SessionInitListener{ @Override

Why when I run a project created with Maven on Jetty it is not found (404)?

倾然丶 夕夏残阳落幕 提交于 2019-12-09 02:13:28
I am started to read the Vaadin 7 CookBook and I got stuck at this point: We are done and we can run our new web application. Go to the root of the project where pom.xml file is located and run the following command. mvn jetty:start I experienced some problems right away when I ran that command: Maven: No plugin found for prefix 'jetty' in the current project... This helped me: http://blog.loxal.net/2014/03/maven-no-plugin-found-for-prefix-jetty.html add something like the following to your ~/.m2/settings.xml org.mortbay.jetty ...to resolve this issue. Now jetty starts: $ mvn jetty:start [INFO

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

How to add tooltip for a item or cell of a vaadin table

丶灬走出姿态 提交于 2019-12-08 18:43:34
问题 I noticed that vaadin 6.7.0 beta1 supports to add tooltip for row/cell of a table. However, I did not find any example how to add it. Is there anybody who can provide some sample? 回答1: Use code as below: table.setItemDescriptionGenerator(new ItemDescriptionGenerator() { public String generateDescription(Component source, Object itemId, Object propertyId) { if(propertyId == null){ return "Row description "+ itemId; } else if(propertyId == COLUMN1_PROPERTY_ID) { return "Cell description " +

Vaadin ComboBox with values and IDs

烂漫一生 提交于 2019-12-08 17:21:19
问题 I have defined a ComboBox which allows the user to select a contact from his contact list. The ComboBox is showing the contact name, but that can not really be used to map to the real contact: the contact ID is needed. My problem is that I do not know how to populate the Vaadin ComboBox with linked values and IDs, but only showing the values. // Add all organization contacts to the drop-down for (Contact contact : organizationContacts) { contactName = contact.getName(); contactId = contact

Configure Maven pom to access Vaadin 14 alpha/beta pre-release

爷,独闯天下 提交于 2019-12-08 12:35:53
问题 I see on the documentation page for Vaadin Flow that while version 14.0.4 is current, there a version 14.0.0alpha1 . Merely updating this element in my Maven POM: <vaadin.version>14.1.0alpha1</vaadin.version> …is not enough, as this pre-release is not yet available in the usual Maven repositories. As I vaguely recall from past experience, I need to configure my POM to access a special Maven repository for Vaadin pre-release versions. But cannot recall the details, and I am no Maven maven. 回答1

vaadin table must sort entries in chronological order descending i.e. latest at the top then down to the earliest notes

时间秒杀一切 提交于 2019-12-08 12:12:59
问题 I have a vaadin table which is displaying Notes, with created date time. I want to sort entries in chronological order descending (i.e. latest at the top then down to the earliest notes) by default. When I added a new value it should be in top. This is a Java EE web application which is using Vaadin. I tried ... setSortContainerPropertyId(NoteContainer.DATE_CREATED); setSortAscending(false); sort(); inside my NoteTable constructor. But it only added the sorting functionality to DATE_CREATED