Created
January 27, 2015 10:41
-
-
Save christoph-frick/31e95a831e4c17de5e90 to your computer and use it in GitHub Desktop.
foolin' around with vaadin elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GrabResolver(name='vaadinAddons', root='http://maven.vaadin.com/vaadin-addons', m2Compatible='true') | |
@Grapes([ | |
@Grab('org.vaadin.spring:spring-boot-vaadin:0.0.3'), | |
@Grab('com.vaadin:vaadin-server:7.4.0.beta2'), | |
@Grab('com.vaadin:vaadin-client-compiled:7.4.0.beta2'), | |
@Grab('com.vaadin:vaadin-themes:7.4.0.beta2'), | |
@Grab('org.vaadin:elements:0.1.1'), | |
]) | |
import org.vaadin.spring.VaadinUI | |
import com.vaadin.server.VaadinRequest | |
import com.vaadin.ui.* | |
import org.vaadin.elements.* | |
@VaadinUI | |
class MyUI extends UI { | |
protected void init(VaadinRequest request) { | |
final root = new CssLayout() | |
ElementIntegration.getRoot(root).with{ | |
appendChild( | |
Elements.create("input").with{ | |
bindAttribute('value', 'change') | |
addEventListener('change', { e-> | |
Notification.show("Value Changed to: ${it.getAttribute('value')}") | |
}) | |
return it | |
} | |
) | |
} | |
setContent(root) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment