Skip to content

Instantly share code, notes, and snippets.

@christoph-frick
Created January 27, 2015 10:41
Show Gist options
  • Save christoph-frick/31e95a831e4c17de5e90 to your computer and use it in GitHub Desktop.
Save christoph-frick/31e95a831e4c17de5e90 to your computer and use it in GitHub Desktop.
foolin' around with vaadin elements
@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