on 2025 Feb 07 2:38 PM
Hi,
I don't understand why the event onSelectionChanged from the class
<core:FragmentDefinition
xmlns:core="sap.ui.core"
xmlns="sap.m"
xmlns:microchart="sap.suite.ui.microchart" >
<HBox>
<microchart:InteractiveDonutChart
id="idDonutChart"
selectionChanged="onSelectionChanged"
press="onSelectionChanged"
selectionEnabled="true"
displayedSegments="8"
segments="{_lgort}">
<microchart:segments>
<microchart:InteractiveDonutChartSegment
value="{QuantityStock}"
label="{= ${StorageLocation} + ' - ' + ${StorageLocationTxt} }" />
</microchart:segments>
</microchart:InteractiveDonutChart>
</HBox>
</core:FragmentDefinition>
sap.ui.define([
"sap/m/MessageToast"
], function(MessageToast) {
'use strict';
return {
onPress: function(oEvent) {
MessageToast.show("onPress");
debugger;
},
onInit: function(oEvent){
MessageToast.show("onInit");
debugger;
},
onSectionLoaded: function(oSection){
MessageToast.show("onSectionLoaded");
debugger;
},
onSelectionChanged: function (oSection) {
debugger;
},
press: function(oEvent){
debugger;
}
};
});
Request clarification before answering.
You need to add your namespace to the press event.
See here for a example: https://ui5.sap.com/test-resources/sap/fe/core/fpmExplorer/index.html#/customElements/customSectionC...
See here the documentation https://sapui5.hana.ondemand.com/#/topic/a357047be956436ebb1dfebf1aa29af2
<core:FragmentDefinition xmlns:core="sap.ui.core" xmlns="sap.m" xmlns:l="sap.ui.layout">
<l:VerticalLayout core:require="{handler: 'SalesOrder/ext/CustomColumn'}">
<Button text="Custom Button" press="handler.buttonPressed" />
</l:VerticalLayout>
</core:FragmentDefinition>
I think it works like this as well:
<core:FragmentDefinition
xmlns:core="sap.ui.core"
xmlns="sap.m"
xmlns:microchart="sap.suite.ui.microchart" >
<HBox>
<microchart:InteractiveDonutChart
id="idDonutChart"
selectionChanged="onSelectionChanged"
press="my.custom.namespace.onSelectionChanged"
selectionEnabled="true"
displayedSegments="8"
segments="{_lgort}">
<microchart:segments>
<microchart:InteractiveDonutChartSegment
value="{QuantityStock}"
label="{= ${StorageLocation} + ' - ' + ${StorageLocationTxt} }" />
</microchart:segments>
</microchart:InteractiveDonutChart>
</HBox>
</core:FragmentDefinition>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
59 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.