vaadin

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:

Asynchronously update vaadin components

血红的双手。 提交于 2019-12-06 07:21:54
问题 I have this code for updating vaadin button's caption every 3 seconds. TimerTask tt = new TimerTask() { @Override public void run() { try { logger.debug("adding l to button's caption"); btn.setCaption(eventsButton.getCaption() + "l"); } catch (Exception ex) { logger.error(ex.getMessage()); } } }; Timer t = new Timer(true); t.scheduleAtFixedRate(tt, 0, 3000); However, it can't change button's caption although it is executed every 3 seconds(judging by the log file). How can I access vaadin's

Handling login with a Vaadin Flow webapp, across all layouts globally and across “route” URLs

天大地大妈咪最大 提交于 2019-12-06 06:30:40
问题 Vaadin 8 In Vaadin 8, in my UI subclass I handled login by examining if a user’s session carried an attribute noting whether they had successfully logged in or not. If not, my UI subclass displayed a login layout rather than other content with navigation options such as menu bar and buttons that switch layout within that UI. Vaadin 10+ In Vaadin 10 and later, Vaadin Flow, the UI class is apparently handled automatically by Vaadin in a manner transparent to me the app developer. Now the @Route

Vaadin converter for java.sql.Timestamp

有些话、适合烂在心里 提交于 2019-12-06 06:29:57
I am working with PostgreSQL database and timestamp columns have class java.sql.Timestamp. Even if this class extends java.util.Date, when I edit PopupDateFiels, I obtain error Unable to convert value of type java.util.Date to model type class java.sql.Timestamp. No converter is set and the types are not compatible. Default converter factory is unable to work properly. I tried to write dateField.setConverter(new DateToSqlDateConverter()); or dateField.setConverter(StringToDateConverter.class); with the same result. By clicking on a day in calendar, I can see valid date and time in european

Java EE 7 CDI - Injection doesn't work, sending NullPointerException

浪尽此生 提交于 2019-12-06 05:23:05
问题 I have a problem with my injection, it's the first time I try it. I'm working with Wildfly and Java EE 7. I've got a NullPointerException when trying to access Authenticator instance in LoginController . I use maven, my beans.xml is found under src/main/webapp/META-INF but I'v tried to put it in src/main/webapp/WEB-INF/classes without success. Here is my code : The class to inject : @Stateless public class Authenticator { @Inject HashGenerator hashGenerator; @Inject UserPersistance

Vaadin Table does not update no matter what I try

旧街凉风 提交于 2019-12-06 05:04:09
I use Vaadin (6.7.4) and this table (it is on a modal window) does not update the view. First it was created with generated columns, but I read that it has problems with table update, so I switched back to normal table, but still no refresh. Updatedata is called by button click event on the panel final Table table = new Table(); final IndexedContainer ic=new IndexedContainer(); public createTable(){ table.setImmediate(true); table.setEnabled(true); ic.addContainerProperty("Name", String.class, null); ic.addContainerProperty("Edit", Button.class, null); ic.addContainerProperty("Delete", Button

What is the method of choice to adjust CSS changes in vaadin?

半世苍凉 提交于 2019-12-06 04:42:15
问题 I am struggling with some minor layout changes in vaadin which has to be done on Java AND Css side. Everytime I need to adjust a layout thing like padding-top, background color or bold text of one component I need to set the style via Java code too: userLink.setStyleName("textbold"); The changes in my styles.css (under VAADIN/themes/app/) would then be: @import "../runo/styles.css"; .textbold { font-weight: bold; } ... Is this the correct way of changing the CSS or is there another way? Can I

Vaadin Table row inline editing

ぐ巨炮叔叔 提交于 2019-12-06 04:13:13
问题 I created a table in vaadin and I have an edit button for each row of the table.I tried table.setEditable(true) but that makes the whole table editable. When I click the button edit I want only the selected row to be editable and if it is possible some cells to be customized example checkbox, dropdown etc. Any suggestions? 回答1: Here is a very simplistic example: final Table table = new Table(); table.setEditable(true); table.setTableFieldFactory(new TableFieldFactory() { private static final

Vaadin+Spring (without SpringBoot) with JavaConfig

♀尐吖头ヾ 提交于 2019-12-06 04:13:12
i'm trying to combine vaadin with spring (without spring-boot) and java-annotation based configuration for the spring part. The autowiring seems to work on the vaadin-ui part but not in "custom-ui classes" (e.g. "public class LoginScreen extends CustomComponent"). I'm getting an NPE or a null-object on SysOut. Further i noticed that "@ComponentScan(basePackages={"net.myapp"})" is not scanning for beans. The only way to declare beans is in the CustomConfiguration itself. XML-Configuration is not something i prefer. I'm following this Tutorial: Link CustomConfiguration.java @Configuration

Vaadin Grid layout borders

送分小仙女□ 提交于 2019-12-06 03:39:48
I have three form with few TextField in my View ( GridLayout ), I need to designate each form with black line borders. How Can I do that. Do I need include css? Thanks in advance! Geir Thomas Jakobsen Yes, you need to add a style to the GridLayout. final GridLayout gridLayout = new GridLayout(); // Add stuff to it ... gridLayout.addStyleName("your-css-tag"); In your theme css (in my workspace webapp/VAADIN/themes/mytheme/mytheme.scss): .your-css-tag { border-style: solid; border-color: black; border-width: 1px; padding: 5px; } You may need a rebuild of your project, to incorporate the CSS. In