cancel
Showing results for 
Search instead for 
Did you mean: 

CDS view Additional binding not updating after change

0 Kudos

Hello,

I have a cds view on which I based an oData service, and for two of the exposed filters I created Value helps: as follows:

Field A: value help from another cds view
Field B: value help from a third cds view, bust with additional binding to field A

  @Consumption.valueHelpDefinition: [{entity:{name: 'fieldB_VH', element: 'key' },
                                              additionalBinding: [{ localElement: 'fieldA', element: 'fieldA' }]}] 

  fieldB,

This works correctly, and in the UI the values selected in fieldA decide what appears in the value help for fieldB.

However, when I select something in fieldA, then select some entries in fieldB, then go back to fieldA and change the selection, the fieldB selection is not updated.

To remedy this I used the following:

onFilterBarInitialized: function(oEvent){	
	var oFieldAControl = oEvent.getSource().getControlByKey("fieldA");
	oFieldAControl .attachChange(this.onFieldAChange.bind(this));	
},
onOpenRefTypeChange:function(oEvent){ var oFieldBControl = this.getView().byId("smartFilterBar").getControlByKey("fieldA"); oFieldBControl.setTokens([]);
},

onFilterBarInitialized is the listener for the Initialized event in the smatFilterBar.
I am not sure about this solution because if in the future the generated control for fieldB no longer has the setTokens method, or if this method no longer has the same behavior, this code will no longer work.

Is there a way to have the same result without changing the control?

junwu
Active Contributor
0 Kudos

i don't think standard function will ever cover this.

Accepted Solutions (0)

Answers (0)