Giter Site home page Giter Site logo

javascriptplusforvaadin's Introduction

JavaScript Plus for vaadin

What is JavaScript Plus for vaadin?

JavaScript Plus for vaadin provides an extended version of vaadin's AbstractJavaScriptComponent (see JavaDoc from vaadin for more info) that is capable of deferred variable changes. Deferred variable change means: a value is not transferred to the server immediately, but instead waits until the next non-deferred action (like a button click) occurs. Then, the value is synced with the servers. Fields (like TextFields) with immediate=false use this.

Deferred variable change has some advantages:

  • the application has a better responsiveness
  • network bandwith and server resources are used economically

Up to now, these advantages were not available in JavaScript. With JavaScript Plus for vaadin, this is about to change.

Now, you have one more method coming with the connector:

connector.setDeferredVariable("varname", somevalue);

on the Java side, you then have

@Override
protected void onChangeVariables(Map<String, Object> variables) {
	Object value = variables.get("varname");
	// do something with value
}

onChangeVariables is called possibly quite after the JavaScript - for instance when a button-click occurs. It is called before event handlers fire, so you can be quite sure to have up-to-date values there.

Using JavaScript Plus for vaadin

Instead of com.vaadin.ui.AbstractJavaScriptComponent you have to use de.akquinet.engineering.vaadin.javascriptplus.AbstractJavaScriptPlusComponent - all other aspects of JavaScript components will remain the same.

Plus: you either have to use a custom widgetset that includes de/akquinet/engineering/vaadin/javascriptplus/JavaScriptPlusForVaadin.gwt.xml or you have to change the widgetset to the pre-compiled version we ship:

@VaadinServletConfiguration(ui = yourui.class, widgetset = "de.akquinet.engineering.vaadin.javascriptplus.JavaScriptPlusForVaadin")

You find a Demo in javascriptplus-for-vaadin-demo and also in sister-project vaangular

javascriptplusforvaadin's People

Contributors

blimster avatar oliverdamm avatar sebastianrothbucher avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.