on 2023 Mar 17 9:42 AM
From 2 places in my application I navigate to the one view which is used for Person Searching.
When I navigate from one place of the app, it works as expected.
But, when I navigate from the second place, it does not.
Code is the same for both places, as it use same view and controller...
Message in console I get:
SmartFilterBar.getControlByKey: called before the SmartFilterBar is initialized .
<smartFilterBar:SmartFilterBar
id="idEmployeeSmartFilter"
entitySet="empl"
showClearOnFB="true"
clear="onClear"
>
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration
key="Lastname"
hasValueHelpDialog="false"
filterType="single"
visibleInAdvancedArea="true"
index="1"
label="{i18n>lastName}"
/>
<smartFilterBar:ControlConfiguration
key="Firstname"
hasValueHelpDialog="false"
filterType="single"
visibleInAdvancedArea="true"
index="2"
label="{i18n>firstName}"
/>
<smartFilterBar:ControlConfiguration
key="Department"
hasValueHelpDialog="false"
filterType="single"
visibleInAdvancedArea="true"
index="3"
label="{i18n>department}"
/>
<smartFilterBar:ControlConfiguration
key="Email"
hasValueHelpDialog="false"
filterType="single"
visibleInAdvancedArea="true"
index="4"
label="{i18n>adEmail}"
/>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>
<smartTable:SmartTable
smartFilterId="idEmployeeSmartFilter"
id="idEmployeeSmartTable"
entitySet="empl"
enableAutoBinding="true"
tableType="ResponsiveTable"
requestAtLeastFields="*"
useExportToExcel="false"
useTablePersonalisation="false"
useVariantManagement="false"
> ..... </smartTable:SmartTable>
Request clarification before answering.
Hi Almedin
As per the error message,your SmartFilterBar is not initialized every time the view is loaded, regardless of where it is being navigated from. The SmartFilterBar fires the initialise event only once after the metadata is analyzed and the inner state is initialised for the first time.
This code checks if the SmartFilterBar control is already initialized. If it is, the necessary code is executed immediately. If it is not, a callback function is attached to the initialise
event. This callback function will execute the necessary code once the control has been initialized.
if(oSmartFilterBar.isInitialised()){
//run some code after initialization
} else {
oSmartFilterBar.attachInitialise();
//run some code after initialization
oSmartFilterBar.getControlByKey("filter");
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for me working
User | Count |
---|---|
81 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.