vaadin7

Restricting file types upload component

╄→гoц情女王★ 提交于 2019-12-07 13:33:24
问题 I'm using the upload component of vaadin(7.1.9), now my trouble is that I'm not able to restrict what kind of files that can be sent with the upload component to the server, but I haven't found any API for that purpose. The only way is that of discarding file of wrong types after the upload. public OutputStream receiveUpload(String filename, String mimeType) { if(!checkIfAValidType(filename)){ upload.interruptUpload(); } return out; } Is this a correct way? 回答1: No, its not the correct way.

Right-align column contents in Vaadin Grid?

独自空忆成欢 提交于 2019-12-07 12:33:46
问题 In the new Vaadin Grid widget (alternative to venerable Table), how does one right-align numbers or other content in a column? 回答1: The simplest way I can think of is to define your own CSS classes and style generator, pretty much similar to what I'd had done when working with tables. @Theme("mytheme") @Widgetset("com.matritza.MyAppWidgetset") public class MyUI extends UI { @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = MyUI.class

Setting Vaadin session-timeout parameter

陌路散爱 提交于 2019-12-07 01:50:45
问题 I am using Vaadin 7.1.7 and I can't figure out how to set session-timeout parameter (to, say, 1min). As far as I can tell, Vaadin 7.x.x does not produce web.xml , it uses @VaadinServletConfiguration annotation but there doesn't seem to be a session-timeout parameter. 回答1: As far as I know there are 2 ways to set session-timeout in Vaadin 7. In the web.xml: <session-config> <session-timeout>1</session-timeout> <!-- 1 minute --> </session-config> <servlet> <servlet-name>MyServlet</servlet-name>

Vaadin - How to open BrowserWindowOpener from a SINGLE BUTTON

房东的猫 提交于 2019-12-06 15:52:33
In the Vaadin example of how to print a dynamically generated PDF they have a two step approach, first you click on the OkButton and then the PrintButton . The problem is that their code to open the PDF relies on creating a new BrowserWindowOpener which then extends the Print button in the ClickListener for the OKButton . In other words they have: okButton.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { // Dynamically generate PDF - this is greatly simplified. StreamResource pdfResource = new PdfStreamResource(); BrowserWindowOpener opener = new

How to run Vaadin 7 applications in Karaf?

寵の児 提交于 2019-12-06 13:09:18
I have been looking for days now, with lots of experiments, for an answer to this question. What do I need to do to be able to run applications, using version 7 of Vaadin Web framework, inside Karaf? There are some information about it but none of the solutions I read worked. The only related question I found on SO ( How to integrate Vaadin 7 with OSGi? ) does not really have an valid answer, at least for my question. Every time I follow a solution found by googling I always get lots of missing dependencies and I found myself indefinitely searching and installing bundles in order to satisfy

Getting rid of web.xml in Vaadin 7 with VaadinServlet

会有一股神秘感。 提交于 2019-12-06 11:12:49
问题 I'm new to Java and Vaadin. A basic Vaadin project is using web.xml for all the mappings. If I want to use the @WebServlet annotation I need to create an inner class which somewhere inherits from HttpServlet . @SuppressWarnings("serial") public class VaadinplaygroundUI extends UI { @WebServlet(urlPatterns="/Helo") public static class Servlet extends VaadinServlet { } @Override protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout(); I know, I'm missing

How to set custom font icon when using a Vaadin declarative UI?

瘦欲@ 提交于 2019-12-06 10:38:28
I am using a custom font icon set as described at the wiki article Font icons in Vaadin 7.2 . Everything works fine. However, if I use the declarative UI I am not able to get it working. This is my code so far: <vaadin-panel caption="..." style-name="..." icon="fonticon://IcoCustom/58884" size-full> UPDATE Allowed syntax: font://INDUSTRY (deprecated syntax, assumes FontAwesome font icon) fonticon://FontAwesome/f275 (font family/codepoint in hex. decimal values not allowed) fonticon://MyFonticon/e900 (for setup custom font icons see @Morfic's answer) Does not work: fonticon://INDUSTRY fonticon:

Right-align column contents in Vaadin Grid?

时间秒杀一切 提交于 2019-12-06 02:36:21
In the new Vaadin Grid widget (alternative to venerable Table ), how does one right-align numbers or other content in a column? Morfic The simplest way I can think of is to define your own CSS classes and style generator, pretty much similar to what I'd had done when working with tables. @Theme("mytheme") @Widgetset("com.matritza.MyAppWidgetset") public class MyUI extends UI { @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = MyUI.class, productionMode = false) public static class MyUIServlet extends VaadinServlet { // meh, default

How to @Inject object from different project module included as jar

主宰稳场 提交于 2019-12-05 22:57:18
问题 I am using Vaadin-CDI in multi-module maven project with one module desired for common classes such interfaces, abstract classes and others. My problem is, that I am not able to @Inject class anotated @UIScoped as usual, which is placed in core module into another. I am still getting UnsatisfiedResolutionException SEVERE: CDI Beans module deployment failed javax.enterprise.inject.UnsatisfiedResolutionException: Api type [com.web.core.TestClass] is not found with the qualifiers Qualifiers: [

Vaadin Grid row height

↘锁芯ラ 提交于 2019-12-05 21:04:45
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] 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. Nebras try to reduce the font size of the grid. Try like below. .v-grid-cell { font-size: 10px; } 来源: https://stackoverflow.com/questions/34438195/vaadin-grid-row-height