maven,netbeans,project,vaadin,vaadin7
I'm not sure if you still need help with this but one of the things you may have missed is the README that appears in the directory of your new Vaadin project. I'll go through the process in as much detail as I can since I'm sure someone else probably...
Decided to anwers this one I found a solution, party for anyone finding it and partly because it didnt get any other answers. The solution was inspired by this answer by someone asking the opersite of what I needed. @Mady pointed out the different includes/excludes in the plugin config Short...
The answer was a combination of things. First the biggest tip I can offer is to look at Consume available space in Vaadin Gridlayout, but consider line breaks After that the code above was using setCaption() when it should've been using setValue(). Combining these two things resolved the issue and...
This is Hibernate 101. For proof-of-concept this is easy. You're best bet is to use Spring transaction + hibernate + dao model...
javascript,jquery,javascript-events,vaadin,vaadin7
Any ideas or better solution will be welcome. That's how batman would do it (code first, explanation later): @SuppressWarnings("serial") @Theme("so5") @JavaScript("batman.js") public class So5UI extends UI { @WebServlet(value = "/*", asyncSupported = true) @VaadinServletConfiguration(productionMode = false, ui = So5UI.class) public static class Servlet extends VaadinServlet { } @Override protected...
java,runnable,vaadin7,vaadin-charts
Here's the implementation for that: https://github.com/vaadin/charts/blob/7a55e8dab5b9941a05603c2624a576866e86045d/examples/src/main/java/com/vaadin/addon/charts/examples/AbstractVaadinChartExample.java#L29 It summary it puts polling with 1 second intervals, starts a new thread and while the UI still exists (=component is attached to UI), it runs the task and waits for one second....
Yes, your project may be a good fit for a Vaadin app. Scalability Scalability can be an issue with Vaadin as your entire app lives on the server, with only a representation of the UI widgets on the client. All your business logic and data structures live on the server,...
How about this (per Svetlin Zarev's suggestion): binder.addCommitHandler(new CommitHandler() { @Override public void preCommit(CommitEvent commitEvent) throws CommitException { String email = (String) commitEvent.getFieldBinder().getField("email").getValue(); EntityManager em = /* retrieve your EntityManager */; List<?> results = em.createQuery("select idCurriculum from Curriculum where email = ?") .setParameter(1, email) .getResultList(); if (results.size() > 0) throw...
Yes it is possible to add/remove steps while running the wizard. wizard.addStep(...) wizard.removeStep(...) You can see here in this demo: http://teemu.virtuallypreinstalled.com/wizards-for-vaadin/#intro Source code: https://github.com/tehapo/WizardsForVaadin/tree/master/wizards-for-vaadin-demo/src/main/java/org/vaadin/teemu/wizards...
I'd say 2.7 with some changes for vaadin. I can't say for sure, but my assumptions are based on the property gwt.version=2.7.0.vaadin3 in this file: https://github.com/vaadin/vaadin/blob/7.5/build.properties Here the same file fore vaadin 7.4: https://github.com/vaadin/vaadin/blob/7.4/build.properties ...
Use float and text-align properties to align components inside CssLayout. SSCCE: @Override protected void init(VaadinRequest request) { setContent(addUpperStripe()); } private Component addUpperStripe() { CssLayout cssLayout = new CssLayout(); cssLayout.setWidth("100%"); cssLayout.setStyleName("csslayout"); Label userNameLabel = new Label("LEFT"); userNameLabel.setSizeUndefined(); cssLayout.addComponent(userNameLabel); userNameLabel.setStyleName("leftPosition"); Label dateLabel = new Label("MID"); dateLabel.setSizeUndefined();...
javascript,java,google-chrome,gwt,vaadin7
I'm able to solve this issue and sharing it here, it might be helpful for others. Removed all old compiled widget sets from the target Recompile the the whole full project again And then I found, it starts working fine....
From the generated README.md: parent project: common metadata and configuration xxx-widgetset: widgetset, custom client side code and dependencies to widget add-ons xxx-ui: main application module, development time xxx-production: module that produces a production mode WAR for deployment For background: with Vaadin you essentially develop web applications with server-only Java code....
java,containers,vaadin,vaadin7
Maybe this is what you are looking for: List<Object> id = new ArrayList<Object>(); List<Item> newItem=new ArrayList<Item>(); //Do this on a button click or something maybe id.add(contFinalGrade.addItem()); //Create Items with those ids and get your property for(int i=0;i<id.size();i++){ newItem.add(contFinalGrade.getItem(id.get(i))); newItem.get(i).getItemProperty("parentCourseId"); ...
java,spring-boot,vaadin,spring-data-jpa,vaadin7
If anyone needs the answer I'll leave here what I found out after a few days of breaking my head on it. Before deploying the application I changed some configurations on the main class that was generated by Spring Initializr (The application one) and made it extend SpringBootServletInitializer because I...
Vaadin WebBrowser The WebBrowser class in Vaadin 7 provides an easy way to access information about the client’s computing environment. Access a WebBrowser object via the current Page object. WebBrowser webBrowser = Page.getCurrent().getWebBrowser(); IP Address The getAddress method provides the apparent IP address of the client computer/device. String ipAddress =...
java,vaadin,vaadin7,vaadin-charts
Theme The various Theme controlling the look of the charts vary widely in their sizing. The new Valo themes (ValoLightTheme and ValoDarkTheme, matching Vaadin’s new Valo theme) tend to be much larger than the previous default, VaadinTheme (matching Vaadin’s Reindeer theme). So one easy way to change sizes of chart...
Move the commented lines below the setContainerDataSource call.
In the constructor class variables are not yet injected. The bean will be injected after initialising, so it is null in the constructor. You have 2 possibilities. Inject the bean in the Constructor. Use the bean in an init method annotated with @PostConstruct I'd recommend the second approach. Here you...
This straight forward workaround solution seems to work fine although it is quite inelegant. textField.setTextChangeEventMode(TextChangeEventMode.LAZY); textField.setNullRepresentation(""); textField.addTextChangeListener(new FieldEvents.TextChangeListener() { @Override public void textChange(FieldEvents.TextChangeEvent event) { try { textField.setValue(event.getText()); // workaround cursor position problem textField.setCursorPosition(event.getCursorPosition()); textField.validate(); } catch (InvalidValueException e) {...
Your code is problematic in several respects. First of all, you're changing the text of the input field while the user is still typing. This makes for an awful user experience, since the user has to take great care that he is not disrupting the number format you plant on...
I just found the solution. Need to replace <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiled</artifactId> <version>${com.vaadin.version}</version> <scope>provided</scope> </dependency> with <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiler</artifactId> <version>${com.vaadin.version}</version> <scope>provided</scope> </dependency> in pom.xml for...
The short answer to this is NEVER EVER (EVER) do this in your UI subclass: @Override public void markAsDirty() { // Empty body (except for this comment) } "But, Steve, why not?" you ask. Well, this method lets the Vaadin framework know that there are unrendered changes that occurred during...
As email is not the Id field, I would use a Query (typed, named or native) first to get the Curriculum object to be updated, then I would update it by EntityManager.merge: EntityManager em = ... TypedQuery<Curriculum> query = em.createQuery( "SELECT c FROM Curriculum c " + "WHERE c.email =...
java,vaadin,vaadin7,verifyerror
You cannot combine Vaadin 6 and Vaadin 7 that way. If you want to use features from Vaadin 7 you need to migrate the whole application to use Vaadin 7. If you want to execute some JavaScript from server side, Vaadin 6 has the Window.executeJavaScript() method that you can try...
jquery,animation,vaadin,vaadin7
There is no code sample and jQuery is not used. The animation uses two concurrent CSS transitions rotating/scaling to opposite directions. It is non-trivial to get right and not all the browsers can do it at all (for those only scaling is used instead of rotation).
A straight forward solution: BeanItemContainer<State> container = new BeanItemContainer<State>(State.class); final BeanFieldGroup<State> binder = new BeanFieldGroup<State>(State.class); binder.setFieldFactory(new DefaultFieldGroupFieldFactory() { @SuppressWarnings("unchecked") @Override public <T extends Field> T createField(Class<?> type, Class<T> fieldType) { if (type.isAssignableFrom(Governor.class) && fieldType.isAssignableFrom(ComboBox.class)) { return (T) new ComboBox(); // we...
So I get you have a rough idea on how Vaadin works. Here's a bit of background info just to clear some things up and maybe give the relevant info to others interested as well. GWT idea is that you do an app in Java and run it through the...
interface,progress-bar,listener,vaadin,vaadin7
There is a thread on vaadin forum worth reading which summarizes this well - Updating UI from another thread: Vaadin consists of a server side that runs in a servlet container and a client side that runs in a web browser. The application state is kept on server side but...
java,validation,vaadin,bean-validation,vaadin7
You can add a commit handler to your FieldGroup. This allows you to check before/after commitment: binder.addCommitHandler(new CommitHandler() { @Override public void preCommit(CommitEvent commitEvent) throws CommitException { // TODO throw new CommitException() if your validation fails } @Override public void postCommit(CommitEvent commitEvent) throws CommitException { // TODO throw new CommitException()...
I have never used the TableExport addon but I have two solutions in my mind: Use String as a property type: table.addContainerProperty("Skill", String.class, null); Create your own extended Label and override the toString() method to return the value you want to see in exported excel sheets. ...
Try Vaadin Addon - Wrapper for CK Editor. Here you can find online demo. It automaticaly localizes to my browser language. You can find more information on official CKEditor site....
Yes and no. Vaadin is a UI framework that can easily be used to build a CMS system, but contains no built in CMS module. E.g. Magnolia, popular CMS platform, has its administration features built using Vaadin. Among Liferay users it is common to use Liferays built in CMS module...
VaadinServlet The VaadinServlet class inherits a getServletContext method. To get the VaadinServlet object, call the static class method getCurrent. From most anywhere within your Vaadin app, do something like this: ServletContext servletContext = VaadinServlet.getCurrent().getServletContext(); CAVEATDoes not work in background threads. In threads you launch, this command returns NULL. As documented:...
javascript,ajax,multithreading,vaadin,vaadin7
The webserver doesn't process requests from the same client in parallel to prevent any race conditions or locking issues. To process long running requests you need to do it asynchronous to the thread that processed the request. When it is finished, write the result back to the UI, using UI.access(...)....
Looks like you're using or at least importing com.google.gwt.user.client.rpc.RemoteService from a Vaadin (i.e. server side) class. This is a client-only interface that is not supposed to be used server side.
Some options: Rich text area: https://vaadin.com/book/-/page/components.richtextarea.html Context menu: https://vaadin.com/directory#!addon/69 I made a quick demo project with a rich text area & a context text area. In the bottom text area I have right clicked & you can see a context menu appears with "Insert" & "Clean". This is customisable &...
Problem seems to be on the JasperPrint printer = JasperFillManager.fillReport(file, parametros,dados); line. Make sure that your report is found (file is not null). In order to show the report, what I usually do is put the resulted pdf in a stream, then create a streamResource with mimeType='application\pdf' and use window.open(resource)...
for the table you can go with the one from vaadin for the folding you could use a tree on the left side of the table in a horizontal layout or you could go with an accordion or with tabsheet and put the table for each continent there. accordion +...
In the web.xml change by: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Vaadin Web Application</display-name> <context-param> <description>Vaadin production...
Unfortunately there aren't. Easy Uploads is just to simplify the upload adding multi files upload, drag and drop upload and loading bar. Multi File Upload is just for manage multi upload and queue of files upload....
One can use the great Attributes add-on by Michael Vogt to inject the spellcheck attribute to any Vaadin component. Usage: Attribute attribute = new Attribute("spellcheck", "false"); attribute.extend(myTextField); ...
java,gwt,vaadin,vaadin7,vaadin-touchkit
I'm not 100% certain if I get what you're trying to do, but you might be able to achieve this through custom CSS. It is hard to write out the exact CSS since it would require seeing the HTML generated by Vaadin and testing it with that, but it would...
Override the protected method Table.formatPropertValue(): public class My_table extends Table { @Override protected String formatPropertyValue(final Object a_row_id, final Object a_col_id, final Property<?> a_property) { if (a_property.getType() == BigDecimal.class && null != a_property.getValue()) { return "formatted-value"; } return super.formatPropertyValue(a_row_id, a_col_id, a_property); } } See Book of Vaadin section 5.16.6. Formatting Table...
Its a well-known issue in Vaadin from version 6. Most people (including me) work-around this by using ContextMenu Addon
I was able to reproduce your problem. It seems that Vaadin guys described the cause here: Vaadin book Quote: A layout that contains components with percentual size must have a defined size! If a layout has undefined size and a contained component has, say, 100% size, the component will try...
Fully-Working Example Below you will find the code for several classes. Together they make a fully working example of a Vaadin 7.3.8 app using the new built-in Push features to publish a single set of data simultaneously to any number of users. We simulate checking the database for fresh data...
java,user-interface,gwt,datasource,vaadin7
I suggest this way: @Override public void valueChange(ValueChangeEvent event) { image.setSource(new FileResource((File)box.getValue())); } ...
apache,session,tomcat,vaadin7,tomcat8
The problem was with vaadin's Push. With push activated, you need to redirect the cookies throught proxy too, in order to keep your session alive, else, it is instantly invalidated. so here is how to do with a vaadin push application behind apache2 proxy : <VirtualHost *:80> ServerName yourdomain.tld ProxyRequests...
Try using Panel within which you can put your bodyContent(vertical layout) using setContent() and can have scroll bars when height of your layout exceeds the panel's height.
java,vaadin,vaadin7,vaadin-charts
First Orange Box The first orange box is not actually white space within the chart. Or, if it is, I do not know how to change it. Second Orange Box The second orange box is "margin" on the Title element. You can call the setMargin method on the Title object....
java,html,templates,vaadin,vaadin7
It's possible to get the generated HTML from client side and transfer it to the server by creating your own client-side extension or by using this example: Dumping the Screen. But if you want to create templates for you emails I suggest to use an approach where you use a...
So when I load the form and click the button the outcome is neither a failure, which it should be because I haven't selected anything yet, nor one of my selections. Combobox is not empty as you think. It has default property value, that you set as empty string:...
As mentioned in the ticket, you can use JavaScript to call client code and also request a cookie value back by that. E.g. @Grapes([ @Grab('org.vaadin.spring:spring-boot-vaadin:0.0.3'), @Grab('com.vaadin:vaadin-server:7.4.0.beta1'), @Grab('com.vaadin:vaadin-client-compiled:7.4.0.beta1'), @Grab('com.vaadin:vaadin-themes:7.4.0.beta1'), ]) import com.vaadin.ui.* @org.vaadin.spring.VaadinUI @groovy.transform.CompileStatic class MyUI extends UI { protected void init(com.vaadin.server.VaadinRequest request) { final resultLabel = new Label() //...
This should work, but there are some issues, especially with some environments. Makes sure you use the latest Vaadin CDI release. With the current 1.0.2 there are this kind of issues with some servers, but the workaround is to upgrade the project to use explicitly DeltaSpike 1.2.1. I a helper...
amazon-ec2,tomcat7,vaadin,war,vaadin7
Solved!... To install the manager: sudo yum install tomcat7-webapps tomcat7-docs-webapp tomcat7-admin-webapps To solve the Java Version mismatch, org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/prueba2]]: On Eclipse: Preferences >> Java >> Installed JREs On EC2 server: sudo yum remove java-1.7.0-openjdk sudo yum install java-1.8.0 Then reinstall Tomcat7 and restart Thanks @BlunT for...
java,vaadin,vaadin7,vaadin-push
I managed to solve the issue by re-navigating to the current view after I reinitialized it. Final UI access method looks like this: public void receiveBroadcast() { access(()->{ navigator.removeView(ContactBookView.NAME); navigator.addView(ContactBookView.NAME, new ContactBookView()); navigator.navigateTo(ContactBookView.NAME); Notification.show("Grid updated", Notification.Type.TRAY_NOTIFICATION); }); With this, the view gets refreshed in the background and pushed to the...
Notification.show() uses Page.getCurrent() to fetch the current page. Page.getCurrent() is a ThreadLocal which is set during a traditional HTTP request-response cycle meaning that Notification.show() works (doesn't return null) during the HTTP request-response thread. In you case Notification.show() is called outside the HTTP request-response thread and that's why it returns null....
It is possible. You will need to jump into Javascript. SSCCE: @com.vaadin.annotations.JavaScript("main.js") public class QwertUI extends UI { @WebServlet(value = "/*", asyncSupported = true) @VaadinServletConfiguration(productionMode = false, ui = QwertUI.class) public static class Servlet extends VaadinServlet { } @Override protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout();...
Solved it. I took an instance of the generated file but you need to use the extended class .. . public class Login extends LoginDesign implements Button.ClickListener { private static final long serialVersionUID = 1L; private UI mainUI; private ClickListener listner = this; public Panel createLoginPanel(UI mainUI) { this.mainUI =...
combobox,type-conversion,converter,vaadin7
Your code cannot be compiled because there is no setConverter() method available on class ComboBox that fits your custom converter. Let me explain how converters are used on select components and what is the idea behind the specific method signatures you find for setting converters on a ComboBox. ComboBox provides...
html,vaadin,production-environment,vaadin7,test-environments
You can check if you are currently running in Vaadin Production Mode like this VaadinService.getCurrent().getDeploymentConfiguration().isProductionMode(); So if you are setting your components id with setId() method, you can easily set it only when not in production mode, for example: boolean isProductionMode = VaadinService.getCurrent().getDeploymentConfiguration().isProductionMode(); if(!isProductionMode) { foo.setID(FOO_ID); } But I would...
If you need ComboBox that give you as a value Language you could extend ComboBox class: class LanguageComboBox extends ComboBox { public LanguageComboBox(String caption, Collection<Language> languages) { super(caption, getShortcuts(languages)); } @Override public Language getValue() { return new Language((String) super.getValue()); } private static List<String> getShortcuts(Collection<Language> languages) { // extract shortcuts using...
java,dependency-injection,ejb,vaadin7
Only in injected objects will have its dependencies injected. If you create an object with new all field having @inject, @ejb or @resource will not be injected. In your case you create UserController like this: UserController userController = new UserController(); and so this field will not be injected: @EJB IUserDAO...
Adding UI components to the data source of a select component (Table, Tree, TreeTable, ComboBox, ...) is the wrong approach for your problem. The container data source of a Table component only contains the data model of the table and not the components that will display this data. So, instead...
just use css: .v-table-scrollposition{ display: none !important;} ...
There is unfortunately no way to consistently check if the browser supports viewing PDF files or not. I would recommend using something like PDF.JS (https://github.com/mozilla/pdf.js) or FlexPaper (http://flexpaper.devaldi.com/products.jsp) on your web site to display your documents to make sure your visitors can see your documents Both those options are available...
Brimby, you were right with your second try. The BrowserWindowOpener extension is the way to go. You should use an ExternalResource instance with an absolute URL like this: public class OpenGoogleUI extends UI { @Override protected void init(VaadinRequest request) { BrowserWindowOpener extension = new BrowserWindowOpener(new ExternalResource("https://www.google.by/#q=vaadin")); Button button = new...
html,css,responsive-design,vaadin,vaadin7
I figured out how to solve the problem with a combination of styling and Java code. The button click event resizes the .sidebarContainer cssLayout. When the sidebar is toggled invisible, the layout width is set to 0. The sidebar container adapts two animation CSS classes for the opening and closing...
You need to enable push in your Vaadin application: Add a dependency to vaadin-push in your project <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-push</artifactId> <version>${vaadin.version}</version> </dependency> Define for the servlet that asynchronous communication is supported and add @com.vaadin.annotations.Push annotation to the UI: @Push public class MyUI extends UI { @WebServlet(value = "/*", asyncSupported =...
java,gwt,vaadin7,custom-widgets
It's not possible to update state from the client side. Only server can update state. You should do so that you sent a RPC request from client to server, and on the server you update the value to state. Edit, here is an example on how to send a value...
Alright, found the correct implementation. I'm going to show you the code at the end. What you need to do: Set an actual instance of Person as your data source for the binder Get rid of the field variable, it's useless in your code, you already have the firstName and...
You could override the setVisibleColumns method: new Table() { @Override public void setVisibleColumns(Object... visibleColumns) { super.setVisibleColumns(visibleColumns); for (Object propertyId : visibleColumns) { setPropertyAlignment(propertyId); } } private void setPropertyAlignment(Object propertyId) { Class<?> clazzProperty = getContainerDataSource().getType(propertyId); if (clazzProperty.isAssignableFrom(Number.class)) { super.setColumnAlignment(propertyId, Align.RIGHT); } else { super.setColumnAlignment(propertyId,...
You are probably looking for a GridLayout, it provides enough flexibility to size your grid 'cells', maintain consistency and set expand ratios for row and columns separately. The other option for you is to use a CustomComponent and in case you are using Vaadin plugin for eclipse (and I don't...
AFAIK you can't register a "listener" on changes in any database systems like MySQL, Oracle or MSSQL. Its not how databases are intended and architectured to work. Workaround is to register JavaScript callback in Vaadin and update table every x seconds. This way you won't even need to enable PushMode...
You would implement a Table.ColumnGenerator for this. Then create the content for the cell there. The content can be "any" vaadin Component. Either use e.g. Label with HTML content and concat your props with <br/> (be aware of XSS!). Or you can also create a vertical layout and add a...
Following up my original comment, you have not posted your MainView class fully but in it's constructor you're not assigning the Navigator navigator variable to a field nor passing it as a parameter to the createSubViewButtons method so you can use it there. If you have indeed a field called...
That's a good question, and one that cannot be answered in a few sentences. I'll try to give you a short answer upfront and will try to elaborate more on this later. I'm currently hacking a small example to demonstrate the feature you want to achieve. But I'll need some...