Hi,
I have a HANA backend system with an oData service defined, with the entity type RecipeHeaderType shown below:
<EntityTypeName="RecipeHeaderType"sap:semantics="aggregate">
<PropertyName="P_SAPClient"Type="Edm.String"Nullable="false"MaxLength="3"/>
<PropertyName="P_KeyDate"Type="Edm.String"Nullable="false"MaxLength="8"/>
<PropertyName="P_Calculation"Type="Edm.String"Nullable="false"MaxLength="20"/>
<PropertyName="P_CalculationOwnerCode"Type="Edm.String"Nullable="false"MaxLength="1"/>
<PropertyName="P_Worklist"Type="Edm.String"Nullable="false"MaxLength="12"/>
<PropertyName="SAPClient"Type="Edm.String"Nullable="false"MaxLength="3"sap:aggregation-role="dimension"sap:label="SAP Client"/>
<PropertyName="RecipeInternalID"Type="Edm.Binary"sap:aggregation-role="dimension"sap:label="Recipe ID"/>
<PropertyName="RecipePrimaryOutput"Type="Edm.String"Nullable="false"MaxLength="12"sap:aggregation-role="dimension"sap:label="Recipe Primary Output"/>
<PropertyName="RecipeAlternativeNumber"Type="Edm.String"Nullable="false"MaxLength="3"sap:aggregation-role="dimension"sap:label="Recipe Alternative Number"/>
<PropertyName="RecipeVersionNumber"Type="Edm.String"Nullable="false"MaxLength="3"sap:aggregation-role="dimension"sap:label="Recipe Version Number"/>
<PropertyName="RecipeDescription"Type="Edm.String"MaxLength="132"sap:aggregation-role="dimension"sap:label="Recipe Description"/>
<PropertyName="RecipeTypeCode"Type="Edm.String"MaxLength="20"sap:aggregation-role="dimension"sap:label="Recipe Type Code"/>
<PropertyName="RecipeTypeDescription"Type="Edm.String"MaxLength="40"sap:aggregation-role="dimension"sap:label="Recipe Type"/>
<PropertyName="RecipeCreatedByUser"Type="Edm.String"MaxLength="12"sap:aggregation-role="dimension"sap:label="Created By User ID"/>
<PropertyName="RecipeCreatedByUserName"Type="Edm.String"MaxLength="80"sap:aggregation-role="dimension"sap:label="Created By"/>
<PropertyName="RecipeCreateDateTime"Type="Edm.Decimal"Precision="15"Scale="0"sap:aggregation-role="dimension"sap:label="Created At"/>
<PropertyName="RecipeChangedByUser"Type="Edm.String"MaxLength="12"sap:aggregation-role="dimension"sap:label="Changed By User ID"/>
<PropertyName="RecipeChangedByUserName"Type="Edm.String"MaxLength="80"sap:aggregation-role="dimension"sap:label="Changed By"/>
<PropertyName="RecipeChangeDateTime"Type="Edm.Decimal"Precision="15"Scale="0"sap:aggregation-role="dimension"sap:label="Changed At"/>
<PropertyName="Status"Type="Edm.String"MaxLength="20"sap:aggregation-role="dimension"sap:label="Status Code"/>
<PropertyName="StatusDescription"Type="Edm.String"MaxLength="60"sap:aggregation-role="dimension"sap:label="Status"/>
<PropertyName="RecipeValidityStartDate"Type="Edm.String"MaxLength="8"sap:aggregation-role="dimension"sap:label="Valid From"/>
<PropertyName="RecipeValidityEndDate"Type="Edm.String"MaxLength="8"sap:aggregation-role="dimension"sap:label="Valid To"/>
<PropertyName="RecipeValidityMinQuantity"Type="Edm.Decimal"Precision="18"Scale="6"sap:aggregation-role="dimension"sap:label="Min. Quantity"/>
<PropertyName="RecipeValidityMaxQuantity"Type="Edm.Decimal"Precision="18"Scale="6"sap:aggregation-role="dimension"sap:label="Max. Quantity"/>
<PropertyName="RecipeValidityUnit"Type="Edm.String"MaxLength="3"sap:aggregation-role="dimension"sap:label="Validity Unit"/>
<PropertyName="RecipePurposeCode"Type="Edm.String"MaxLength="5"sap:aggregation-role="dimension"sap:label="Recipe Purpose Code"/>
<PropertyName="RecipePurposeDescription"Type="Edm.String"MaxLength="40"sap:aggregation-role="dimension"sap:label="Recipe Purpose"/>
<PropertyName="Plant"Type="Edm.String"MaxLength="4"sap:aggregation-role="dimension"sap:label="Plant ID"/>
<PropertyName="PlantName"Type="Edm.String"MaxLength="30"sap:aggregation-role="dimension"sap:label="Plant Name"/>
<PropertyName="AuthorizationGroup"Type="Edm.String"MaxLength="10"sap:aggregation-role="dimension"sap:label="Authorization Group"/>
<PropertyName="AuthorizationGroupDescription"Type="Edm.String"MaxLength="40"sap:aggregation-role="dimension"sap:label="Authorization Group"/>
<PropertyName="RecipeIsTopLevel"Type="Edm.String"MaxLength="1"sap:aggregation-role="dimension"sap:label="Is Top Level"/>
<PropertyName="Worklist"Type="Edm.String"MaxLength="12"sap:aggregation-role="dimension"sap:label="Worklist"/>
<PropertyName="RecipeInternalID_E"Type="Edm.String"MaxLength="32"sap:aggregation-role="dimension"sap:label="Recipe Internal ID External"/>
</EntityType>
In my view controller, OnInit, I set the model:
sURL = "/system/odata/Recipe.xsodata/";
oModel = new sap.ui.model.odata.ODataModel(sURL, true);
oModel.setCountSupported(false);
oView.setModel(oModel);
In my view xml I set up the Smart Filter Bar, with custom config for filters for columns AuthorizationGroupDescription, RecipeTypeDescription, Plant and StatusDescription. Note that the service metadata from HANA does not give me sap:filterable, so I have to add them in the control configuration.
<smartFilterBar:SmartFilterBar id="ra.SmartFilterBar" entityType="RecipeHeaderType" search="onSearchButtonPressed" initialise="onInitDone" reset="onReset" persistencyKey="dfgfdg">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="AuthorizationGroupDescription" index="1" visible="true" controlType="dropDownList" mandatory="notMandatory" hasValueHelpDialog="true" groupId="_BASIC" >
</smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="RecipeTypeDescription" index="2" visible="true" controlType="dropDownList" mandatory="notMandatory" hasValueHelpDialog="false" groupId="_BASIC" >
</smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="Plant" index="2" visible="true" controlType="dropDownList" mandatory="notMandatory" groupId="_BASIC" >
</smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="StatusDescription" index="2" visible="true" controlType="dropDownList" mandatory="notMandatory" groupId="_BASIC" >
</smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>
You can see from above I have set control type to dropwDownList. Makes no difference whether I have hasValueHelpDialog true or false, I do not get any values in value help upon clicking the drop-down.
Wondering whether this is a limitation of the metadata provided by HANA? When I click on the + icon to add more filter fields I can see all of the exposed columns from my HANA odata service, so proves the SmartFilterBar is bound to the service and can access the service metadata.
Grateful for any help/suggestions.