on 2021 Dec 05 11:23 AM
Hello guys,
I want the "Pernr" search help to be mandatory when only "01" is selected from my "Empty type (Zmtrk)" search help field in the smartfilterbar. From the mandatory Search help, I want some search help to be mandatory according to the selected data. How do I do this? setMandatory did not work. Is there any other method?
Main.xml
<smartFilterBar:SmartFilterBar id="smartFilterBar" entityType="GetData" smartVariant="PageVariant" persistencyKey="PKeyFilterbar" useDateRangeType="true" <br>filterChange="filterChange" search="onSearch">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration id="zmtrk" key="Zmtrk" label="{/#GetData/Zmtrk/@sap:label}" controlType="dropDownList"
preventInitialDataFetchInValueHelpDialog="false" visibleInAdvancedArea="true" index="1" filterType="single" mandatory="mandatory"/>
<smartFilterBar:ControlConfiguration id="pernr" key="Pernr" label="{/#GetData/Pernr/@sap:label}"
preventInitialDataFetchInValueHelpDialog="false" visibleInAdvancedArea="true" index="2" filterType="multiple"/>
<smartFilterBar:ControlConfiguration key="Kostl" label="{/#GetData/Kostl/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
visibleInAdvancedArea="true" index="3" filterType="multiple" mandatory="notMandatory"/>
<smartFilterBar:ControlConfiguration key="Anln1" label="{/#GetData/Anln1/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
visibleInAdvancedArea="true" index="4" filterType="multiple" mandatory="notMandatory"/>
<smartFilterBar:ControlConfiguration key="Anln2" label="{/#GetData/Anln2/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
visibleInAdvancedArea="true" index="5" filterType="multiple" mandatory="notMandatory"/>
<smartFilterBar:ControlConfiguration key="Erdat" label="{/#GetData/Erdat/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
visibleInAdvancedArea="true" index="6" mandatory="notMandatory" conditionType="sap.ui.comp.config.condition.DateRangeType"/>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar><br>
Main.controller.js
filterChange: function(oEvent) {
if (ZmtrkKey === "03") {
this.getView().byId("pernr").setMandatory("mandatory");
// globalModel.setProperty("/pernrMandatory", "mandatory");
}
}
I would be glad if you help.
Request clarification before answering.
Did you find a solution for this issue ? The method setMandatory can only be set during initialization. Changes at runtime are getting ignored.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
10 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.