Skip to content

JavaScript Integration helpers

Pre-release
Pre-release
Compare
Choose a tag to compare
@pleku pleku released this 25 Jul 08:52

New features

  • Provide $element to template event handlers
    • (click)="$server.clickOnText($element.textContent)
    • Refers to the element that has the listener, not $event.target
  • Generalize @EventHandler from Template into a Component feature
    • $server callbacks available in element.$server on the client side
    • @EventHandler public void MyComponent.publishedMethod(int someNumber); on the server defines the method, theElement.$server.publishedMethod(42) on the client invokes the method
  • Add Element.callFunction for invoking JavaScript methods on elements
    • e.g. myWebComponent.getElement().callFunction("setValue",12)

Fixes

  • Throw an exception if arrays are used in a Template Model
  • Ensure assertion errors are not shown as empty messages
  • Fix unclear error message for @EventHandler method with non-void return type
  • Don't include <script> from Template into pre-render HTML

Demos

No changes

Tutorials

All changes

https://github.com/vaadin/hummingbird/milestone/18?closed=1