cancel
Showing results for 
Search instead for 
Did you mean: 

smartfield valueListChanged event not triggering?

0 Kudos

valueListChanged of smartfield is not triggering, do i need to add extra parameters to work?

mvaibhav
Contributor
0 Kudos

hi raghavendra nookala,

which version if UI5 are you using ?

Also can you share your view and XML code ?

Thanks,

Vaibhav

0 Kudos

Hi Vaibhav,

I am using 1.60 version,please find the below xml code

<smartField:SmartField id="mat" value="{Material}" showValueHelp="true" valueListChanged="onvallistchange"/>

Thank You

mvaibhav
Contributor
0 Kudos

As per documentation, The event is fired when after selection of values with value help or auto-suggest, the model is updated with the selected data.

So when the value help is opened and values are selected, the event is not getting triggered when the value help closes.

Can you please share your annotation file along with the controller code ?

0 Kudos

Thanks for helping to figure out the issue, below are the annotation that are used in cds view, i havenot written any controller code for that method,just writen one alert msg in side the method.

@UI:{ lineItem: [{ position: 20 } ] , selectionField: [{ position: 20 }] } @Search.defaultSearchElement: true @Search.fuzzinessThreshold: 0.8 @UI.identification.position: 20 @ObjectModel.foreignKey.association: '_Material' Items.Material,

View Entire Topic
dalibor_riger
Explorer
0 Kudos

I had similar problem when event valueListChanged of Smart Field did not trigger. Problem was in parameters passing from Value Help dialog back to Smart Field. I passed back non key field of VH entitySet. When I added to annotation entry com.sap.vocabularies.Common.v1.ValueListParameterInOut also for key field of VH entitySet, then it triggered the event.

As a matter of fact, you can pass back value for field not just used in the Smart Field but you can pass it back to any field in main entitySet. In my case I use CustomerName for display in Smart Field and CustomerId as hidden technical field.