Skip to Content
avatar image
Former Member

Selected key on sap.m.Input not reflected on loading page

I'm having nearly identical issues as described in this post:

https://archive.sap.com/discussions/thread/3498176

However, in my case, the sap.m.Select elements are loading correctly, but a sap.m.Input element is not using the selected key I provide and defaulting to an empty input box. (The input element shows the correct data upon nav back and forth, which was also mentioned in the above post).

I was wondering if there was an update to sap.m.Select to address this issue that wasn't made to the sap.m.Input element. Also, how can I force the Input to show the element with the selectedKey I provided?

More details :

I am filling an Input field with suggestionItems from one service, and using a key from another service (both services have this key) to set the selectedKey value. This does not work upon the initial load, but if any change is made later on, it works.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 23 at 12:09 PM

    I have the same issue. Looks like the only workaround is onetime binding for value property. Any other suggestions?

    Francesco, did you solved this issue?

    BR,

    Denis

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 23 at 01:08 PM

    It's always so hard to assist without exposing your code.

    Your input should appear as below (obviously apply your own contextualizations):

    <Input
       id="inputModel"
       type="Text"
       placeholder="Insert the Model and Model Details"
       valueLiveUpdate="true"
       valueStateText="Model must have a value - minimum 3 characters - maximum 80"
       value="{
           path : 'asset>/Model' ,
           type : 'sap.ui.model.type.String',
           constraints : {
                minLength: 3,
                maxLength: 80
           }
       }" />
    
    
    
    Add comment
    10|10000 characters needed characters exceeded

    • no, i have two models. first for search helps, second for the form. regarding binding, search help model consists of two fields: Vessel (which is ID) and VesselName.

      now, the idea is allow user to see and select by vesselname and keep vessel ID behind. the same way as it works for combobox. i've discovered that it works but only when second model loads. if i enter form, quit and enter again Vessel name appears, but it's empty on the very first entry.

      BR,

      Denis