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.
Hello,
You can manage the mandatory field thanks to another entity. This entity can be binded to a Dropdown list and then you have dynamically behaviour of the Smartfield thanks to the selected item of the Dropdown.
Regards,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Demir,
The method setMandatory can only be set during initialization. Changes at runtime will be ignored.
You may try value state control though you would miss the mandatory symbol or using other better workaround.
B.R.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 |
---|---|
48 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
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.