issue in #11343 and #11385 is not reproducible on top this patch
Three different bugs are involved in this fix:
we bring the old fix(#11094) back and fixed the other related issues:
1) allow adding the same new item after dataProvider got reset, This is cause by the client side parameter `LastNewItemString`, it saves the value added before resetting.
2) clear the pending newItem eagerly, so that the same value will not be added again.
In some places, getWidget() is called many times, and I believe this can
have a litte performance improvement, since in some cases
super.getWidget() is called more than once.
* Reduce ComboBox initial requests
Use initial fetched data on client side,
do not request data from server side for each time popup is opened.
Fixed initial filter being null for ComboBox on DataProvider,
causing unnecessary size & fetch for not-changed filter.
Fixed ComboBox sending default filter unnecessarily to server.
Fixed wrong page indexing in VComboBox -> ComboBoxConnector.
Fixes #8496
Fixes vaadin/framework8-issues#488
* Fix last item missing
When pageLength was 0 and nullSelectionAllowed,
the last item was not shown. Tried to sensify the API
for total suggestions versus total suggestions + null selection item.
* Fix ComboBox selected item updates
Handles changing of ItemCaptionGenerator or ItemIconGenerator,
need to update the selected item caption and icon separately.
Previously it worked because all data was sent all the time to client.
Doesn't fix the issue, when selected item is updated with refreshItem(),
and it is not on the active range that will be sent to client.
For that, ComboBox would need a separate notification about item update.
* Updated screenshots
Replace setRequired & HasRequired with setRequiredIndicator
Vaadin 7 compatiblity fields still use setRequired via AbstractField (legacy).
Public setRequiredIndicator is added to AbstractField, AbstractMultiSelect and AbstractSingleSelect.
Internally it is still handled on AbstractComponent & -Connector level.
Changes the declarative syntax, required -> required-indicator-visible.
Fixes vaadin/framework8-issue#419
Change-Id: I940dc66944d27584bd78e5452aee627ee3abd03a
Update ComboBox for new DataSource and communication mechanism
This simplifies the client side state machine.
This change does not modify the CSS class name v-filterselect.
Change-Id: I2f4a6e5252045cb7698d582be90693e00961b342
- Move waitingForFilteringResponse etc. to the data received
handler.
- Change some setters to parameterless methods that trigger a
state transition.
Change-Id: Iaf2547df1e6e61a1cb25b74172ea0fb095068375
Use a separate data received handler in VFilterSelect (#19929)
Move parts of the request handling to a separate handler
class that keeps track of the current communication state etc.
This is an intermediate change. Later changes should move
waitingForFilteringResponse etc. to the handler.
Change-Id: Ic248aa463ae0b194f95e5e4ce92e9d26627ddfeb
Move the handling of selection when a navigation operation
pends on server reply to the connector, with a callback
that actually performs the selection.
Change-Id: I941defbf2fe85d0f4d6ed58b7e65799c35a11aa1
This is an intermediate step towards refactoring the
communication related client side internal state management.
Change-Id: I252988cae5e19883ea0acc283bdda69473dc4f85
All client to server communication of ComboBox is now done
with RPC.
There is still an empty changeVariables() methods to
override the default behavior in AbstractSelect.
Change-Id: I718eeabd5c116ec4e00485ed37a0a6d5389ee1f0
Use shared state for the page length and update related tests.
This change also removes an unused widget field.
Change-Id: I22055ea058029f898af952252a0c3dadcd9476d4
Send focus and blur events using RPC instead of in UIDL.
This change does not use ConnectorFocusAndBlurHandler to preserve
old timings.
Change-Id: I02a86dcc3959388ca835798a33cb600898b19ab9
This change extracts the client to server communication
methods of VFilterSelect and moves them to the connector.
Change-Id: If9b10455d1d32e11bfd6077dcaccbc4841b300f0
Without the fix, when selecting a value from page n+1 and re-opening the
ComboBox popup, the content of the text box may disappear.
Change-Id: I5fb57c0e5a068645f4b11fb1c392e682dd04b06a
Added API setPopupWidth(String) to ComboBox. The suggestion pop-up now
has three different width modes:
1. Legacy "null"-mode: width is determined by the longest item
caption for each page. This looks & feels like the old implementation.
This is the default mode
2. Relative to the ComboBox. e.g. 100%
3. fixed width using any CSS definition
Change-Id: Id60a6996ee82726196b84d50c2d0d18a6cfb5ebf
Selection is now shown although scrollToSelectedItem is false (#16673)
If scrollToSelectedItem is set to false (which is needed to work
properly with
large datasets) the selected item caption is sent to client with a
special
attribute to avoid the field looking like unselected.
Change-Id: Ib80355c3b52faaaeaa9ab7195644701cc3bf0d15
Redesign ComboBox filtering, highlighting and selection behaviour.
(#15502, #9369)
Changes:
- When opening the popup, the first suggestion is always highlighted by
default unless adding new items is allowed.
- When filter matches currently selected item, that item will be
highlighted instead of the first item.
- Hitting enter or tab will always select the highlighted item.
- Closing the suggestions list by clicking outside the list no longer
selects an item to prevent accidental selections.
Test changes:
- Extended ComboBoxElement to help test filtering.
- Updated and tweaked ComboBoxResetValueTest,
ComboBoxIdenticalItemsTest and ComboboxScrollableWindowTest.
- Added ComboBoxSelectingTest and
ComboBoxSelectingWithNewItemsAllowedTest.
- Updated some tests that were using keyboard navigation.
Change-Id: Ia7745b624bdb0b1a1bb498157ebcb37bee219d76
Fixed regression with changing widths when stylenames have changed (#13444, #8801):
Changing the name of a style should not cause the width of the textbox
to change. If there is a width set for the wrapper, the width for the
wrapper should not change if the styles changes.
To reconcile these two demands, we have removed the width for the
wrapper and only manipulate the width of the textbox itself. This
solves both issues neatly.
Change-Id: Idb2dbc5d2ca6406cafb44df93110e079a1dff473