vaadin

Vaadin - center custom component

霸气de小男生 提交于 2020-01-04 17:39:46
问题 Using Grails 2.3.9 and Vaadin plugin 7.3.9 class MyUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { VerticalLayout layout = new VerticalLayout() layout.setMargin(true) SignInForm signInForm = new SignInForm() layout.addComponent(signInForm) layout.setComponentAlignment(signInForm, Alignment.MIDDLE_CENTER) layout.setSizeFull() setContent(layout) } } Custom component class SignInForm extends CustomComponent { Panel p = new Panel() public SignInForm() { p

Vaadin - center custom component

情到浓时终转凉″ 提交于 2020-01-04 17:39:12
问题 Using Grails 2.3.9 and Vaadin plugin 7.3.9 class MyUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { VerticalLayout layout = new VerticalLayout() layout.setMargin(true) SignInForm signInForm = new SignInForm() layout.addComponent(signInForm) layout.setComponentAlignment(signInForm, Alignment.MIDDLE_CENTER) layout.setSizeFull() setContent(layout) } } Custom component class SignInForm extends CustomComponent { Panel p = new Panel() public SignInForm() { p

Change column name - Vaadin 7.8.4

萝らか妹 提交于 2020-01-04 09:19:09
问题 I use IndexedContainer in my grid. Grid grid = new Grid(); IndexedContainer container = new IndexedContainer(); grid.setContainerDataSource(container); container.addContainerProperty("Something", String.class, ""); I need to change the name of the container property. E.g property "Something" to "New property" after the click on the button. Any ideas ? Thank you very much ! 回答1: NOTE 1: Where did you get vaadin 7.8.4 from? The latest 7.x release I can see is 7.7.10. For this exercise I'll

Where to find offline installer for Vaadin 7?

北战南征 提交于 2020-01-04 04:45:14
问题 I'm working with Vaadin 7, Eclipse(Juno) and Java EE 7. I want to use the Eclipse Vaadin plugin to create and compile Vaadin projects. The problem is that the Vaadin plugin insists on checking the vaadin website for updates before doing just about anything (and crashes my eclipse when it can't do it) - I am behind a very restrictive network and cannot use it in this way. I found this: https://vaadin.com/directory#addon/vaadin-plug-in-for-eclipse Which is a downloadable offline repo for Vaadin

Preventing Clickjacking attack by Vaadin

浪子不回头ぞ 提交于 2020-01-04 02:19:06
问题 I want to prevent clickjacking attack in Vaadin 7 and 8 apps. As Vaadin applications are by default designed to be embeddable, some configuration or code is needed to add safety. Here's my first experiment, which adds X-Frame-Options header to each response to force browser to use same origin policy. public class MyVaadinServlet extends VaadinServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // add

How to prevent Eclipse+Tomcat from running current class instead of project (Vaadin)

喜欢而已 提交于 2020-01-03 04:21:05
问题 This may well prove to be a simple config change, but I can't seem to find an obvious setting to solve the following problem: I have a Vaadin project in Eclipse, which is configured to be debugged with Tomcat v6. If I select the top of the project in the project explorer and hit debug, the eclipse browser launches and my web app opens with the following url: http://localhost:8080/MyVaadinProject/ THIS WORKS However, if I'm currently looking at a java file (say Myproject.java), Eclipse tries

Native Select of Locale in Vaadin

谁说我不能喝 提交于 2020-01-03 03:01:41
问题 I'm using Vaadin . I want to use Native Select to switch between locales. @Override public void valueChange(ValueChangeEvent event) { UI.getCurrent().setLocale(loc); } I wanted to use event.getProperty() but "loc" have to be Locale type. How can i get value of native select and convert it into Locale type? 回答1: I would guess that you are populating NativeSelect like this: nativeSelect.addItem(Locale.ENGLISH); nativeSelect.addItem(Locale.GERMAN); ... // you can also use setItemCaption(objectId

mixing user session data in jboss

不打扰是莪最后的温柔 提交于 2020-01-03 02:23:09
问题 if someone can help with JBoss returning data from wrong user. Our setup is JBOSS 7.1.1 with Vaadin 7.1.6 and Shiro. Our current problem is when multiple users use our Vaadin application it frequently returning data from other users to another curently loged user,. ie it is mixing users data. We have tried reinstaling the PC, changing browsers, disabling caching..., nothing helped. We aded CDI UI addon from Vaadin but it doesnt help. Our previous issue with similar problem Shiro returning

Vaadin 7.0.1 Combobox with JPAContainer and FieldGroup

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 08:48:13
问题 (Sorry if this is a bit of a newb question) I have two JPAContainers, one for an Employee class/table and one for Language class/table. An employee can have a selected language. I am trying to create an Employee editing form with a combobox for the language selection and FieldGroup to handle the binding and creation. I can get the drop down to include the entries from the Languages table via the JPAContainer but it will not display the value already in place in the Employee record. What am I

Vaadin (Flow): Navigating to destination with a shared object

拜拜、爱过 提交于 2020-01-02 08:34:31
问题 Problem: I currently have a grid that displays content of type SomeModel . When I click an entry of that Grid I would like to navigate to a view that takes an object as its input to display the entries content. Implementation: To achive this behaviour I created a DetailLayout like this: public DetailLayout extends FlexLayout implements HasUrlParameter<SomeModel>{ /* skipped some details */ @Override public void setParameter(BeforeEvent event, Host parameter) { /* This is where I expected to