Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2175

suggestionItemSelected and pasting values

$
0
0

Hi all,

 

I have a question on how to achieve something in a correct way regarding the usage of an input suggestion value.

 

I have a view in which the user must enter a material number, the key of this table is not only the material number but a combination of the material number and the source system to which it belongs (e.g.: AP, 0000000123312). I now have the following code in the xml view:

 

<Input placeholder="{i18n>materialPlaceHolder}" showSuggestion="true" suggestionItemSelected="onPress" suggestionItems="{/ZT_GL_MATERIAL}">

    <suggestionItems>

         <core:ListItem text="{MATERIAL}" additionalText="{SOURCESYSTEM}"/>

    </suggestionItems>

</Input>

 

In the controller of the view I created a eventHandler called "onPress" (name needs to change but I started with a button ;-) ) and in there I added the code:

 

      oItem = oEvent.getParameter("selectedItem");

      oContext = oItem.getBindingContext();

      this._oPath = oContext.getPath();

 

I can now bind the form with the code (which happens in another function since I load a fragment on the page first):

 

oForm.bindElement({path: this._oPath });

 

So far so good, this all works like a charm, the idea is that the user types a material number and when they select a suggested item it will show the full record below the input field in a non-editable form and then they can decide to mark this specific record as 'obsolete' in the database.

 

The problem however is that the users who are allowed to execute this change will get the material numbers which should be marked by email so the chance is pretty big that they will not type the number but paste it... Therefore I had originally also a button next to the input field, however, when they paste the material number the suggestions are not shown so they can only press enter or click on a button. But even though I could of course execute the same function I now do not have the full key any more (since they only paste the material number).

 

What would be a good way to fix this? Can you disable pasting values and if yes how (doesn't sound really user friendly), or can you also show suggestions somehow when pasting a value?

 

Edit:

I see I made a small mistake due to which pasting a value did not show suggestions, however, the issue remains... I attached a screenshot of a value I pasted in the input field. It now does show a suggestion and when I select it, it works but a lot of users will probably just press enter which hides the value suggestion but does not do anything... any idea how to do this in a user friendly way?

 

Kind Regards,

Nico van der Linden

 

Message was edited by: N. van der Linden


Viewing all articles
Browse latest Browse all 2175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>