Let's say I want to handle a button event that does not execute any business logic, just updates the DOM:
Button button = new Button("Click Me"); button.addClickListener(evt -> button.setCaption("Clicked!"));
This makes the event round-trip and adds load to the server.
Now I can do the same with JavaScript (with jQuery):
Button button = new Button("Click Me"); button.setId("button"); JavaScript.getCurrent().execute( "$('#button').click(function(){" + " $('#button').find('.v-button-caption').text('Clicked!');" + "})" );
Is it server side optimization?Will the Vaadin client engine not send a request at all if listeners are not connected?
Button ( "" ). - . , , ( ).
Button
, , , (, GWT AbstractJavascriptComponent).
AbstractJavascriptComponent
JQuery: ( ), - - . , , , " , , "
, . UI .
UI
192.x.x.x - - [03/Jan/2018: 09: 56: 20 +0200] "POST/vaadin-test/UIDL/? v-uiId = 0 HTTP/1.1" 200 157
, , . , Vaadin Button , .
, . - -, , I/O - , ( ) . SSD-, , , , , .
Therefore, avoiding the network is an optimization method. Why do you think caching is so common in network applications?
Source: https://habr.com/ru/post/1691653/More articles:Convert decimal to triple (base3) in python - pythonEscape - shortcut I don't want in pycharm, how to change? - pythonBasic python conversion with given string - pythonExclude null key from hashmap that is present inside arraylist - javaWhy doesn't this BitBlt example work anymore? - cКак установитьFloat значение PreparedStatement (jdbc) в NULL - javaAvoid copying when invoking delegate constructors - c ++Почему UserDefaults.standard.set не сохраняет мой массив? После удаления приложения из фона данные очищаются - iosWhy is MAX working on a column in the middle of the index - mysqlC # LINQ query creating inefficient SQL compared to the original query - c #All Articles