diff --git a/eclipse-scout-core/src/form/fields/smartfield/ProposalField.js b/eclipse-scout-core/src/form/fields/smartfield/ProposalField.js index 0bcf975c73f..4076cefe097 100644 --- a/eclipse-scout-core/src/form/fields/smartfield/ProposalField.js +++ b/eclipse-scout-core/src/form/fields/smartfield/ProposalField.js @@ -170,6 +170,12 @@ export default class ProposalField extends SmartField { } _acceptInput(sync, searchText, searchTextEmpty, searchTextChanged, selectedLookupRow) { + if (this.touchMode) { + $.log.isDebugEnabled() && $.log.debug('(ProposalField#_acceptInput) Always send acceptInput for touch field'); + this._inputAccepted(true, !!selectedLookupRow); + return; + } + // Do nothing when search text is equals to the text of the current lookup row if (!selectedLookupRow && this.lookupRow && this.lookupRow.text === searchText) { $.log.isDebugEnabled() && $.log.debug('(ProposalField#_acceptInput) unchanged: text is equals. Close popup'); diff --git a/eclipse-scout-core/src/form/fields/smartfield/SmartField.js b/eclipse-scout-core/src/form/fields/smartfield/SmartField.js index aef7b57cb39..cb6159d73a8 100644 --- a/eclipse-scout-core/src/form/fields/smartfield/SmartField.js +++ b/eclipse-scout-core/src/form/fields/smartfield/SmartField.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2022 BSI Business Systems Integration AG. + * Copyright (c) 2010-2024 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -232,12 +232,6 @@ export default class SmartField extends ValueField { this._flushLookupStatus(); this._clearPendingLookup(); - if (this.touchMode) { - $.log.isDebugEnabled() && $.log.debug('(SmartField#acceptInput) Always send acceptInput for touch field'); - this._inputAccepted(); - return; - } - return this._acceptInput(sync, searchText, searchTextEmpty, searchTextChanged, selectedLookupRow); } @@ -287,6 +281,11 @@ export default class SmartField extends ValueField { * @param [sync] optional boolean value (default: false), when set to true acceptInput is not allowed to start an asynchronous lookup for text search */ _acceptInput(sync, searchText, searchTextEmpty, searchTextChanged, selectedLookupRow) { + if (this.touchMode) { + $.log.isDebugEnabled() && $.log.debug('(SmartField#_acceptInput) Always send acceptInput for touch field'); + this._inputAccepted(); + return; + } let unchanged = false; if (this.removing) { diff --git a/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/form/fields/smartfield/JsonProposalField.java b/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/form/fields/smartfield/JsonProposalField.java index 95375a5baa9..56b5f4f30fe 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/form/fields/smartfield/JsonProposalField.java +++ b/org.eclipse.scout.rt.ui.html/src/main/java/org/eclipse/scout/rt/ui/html/json/form/fields/smartfield/JsonProposalField.java @@ -1,24 +1,20 @@ /* - * Copyright (c) 2014-2017 BSI Business Systems Integration AG. + * Copyright (c) 2010-2024 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-v10.html * * Contributors: * BSI Business Systems Integration AG - initial API and implementation */ package org.eclipse.scout.rt.ui.html.json.form.fields.smartfield; -import org.eclipse.scout.rt.client.ui.form.fields.IValueField; import org.eclipse.scout.rt.client.ui.form.fields.smartfield.IProposalField; -import org.eclipse.scout.rt.client.ui.form.fields.smartfield.ISmartField; import org.eclipse.scout.rt.platform.util.Assertions; import org.eclipse.scout.rt.ui.html.IUiSession; import org.eclipse.scout.rt.ui.html.json.IJsonAdapter; -import org.eclipse.scout.rt.ui.html.json.JsonEvent; import org.eclipse.scout.rt.ui.html.json.JsonProperty; -import org.json.JSONObject; public class JsonProposalField> extends JsonSmartField { @@ -60,25 +56,4 @@ protected Object valueToJson(VALUE value) { protected void setValueFromUI(Object value) { getModel().getUIFacade().setValueAsStringFromUI((String) value); } - - @Override - protected void handleUiAcceptInput(JsonEvent event) { - JSONObject data = event.getData(); - if (data.has(IValueField.PROP_DISPLAY_TEXT)) { - this.handleUiDisplayTextChange(data); - } - if (data.has(IValueField.PROP_ERROR_STATUS)) { - this.handleUiErrorStatusChange(data); - } - // The difference to the smart-field is that the proposal-field - // can receive lookup-row and value in a single event. For instance: - // lookupRow=null, value=Foo (in case a custom text has been set) - if (data.has(ISmartField.PROP_LOOKUP_ROW)) { - this.handleUiLookupRowChange(data); - } - if (data.has(IValueField.PROP_VALUE)) { - handleUiValueChange(data); - } - } - }