cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Smart Table filter not working when place smart table inside a dialog popup

0 Kudos

I have a sapui5 smarttable inside a fragment that used in a dialog to display the table in a popup. I've given all the required parameters to the smarttable and smart filter. But when I click the GO button on the filter it doesn't do any thing. (not even a request is calling)

But filter suggestions are displaying when I type some text in a filter field. Pagination and data displaying also working correctly.

Don't know the reason. Do you have any idea????

Source

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"
    xmlns:smartTable="sap.ui.comp.smarttable" xmlns:smartField="sap.ui.comp.smartfield" xmlns:unified="sap.ui.unified"
    xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">
    <smartFilterBar:SmartFilterBar id="actionItemHistoryFilterBar" entitySet="VTicketPOActionItemHistory"
        persistencyKey="actionItemHistoryFilterBar_Persis">
    <smartFilterBar:controlConfiguration>
            <smartFilterBar:ControlConfiguration key="TICKET_ID" index="0" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"
                label="{@i18n>poActionItemHistoryTicketId}"></smartFilterBar:ControlConfiguration>
            <smartFilterBar:ControlConfiguration key="PO_NUMBER" index="1" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"
                label="{@i18n>poActionItemHistoryPONumber}"></smartFilterBar:ControlConfiguration>
            <smartFilterBar:ControlConfiguration key="ACTION_ITEM" index="2" visibleInAdvancedArea="true"
                preventInitialDataFetchInValueHelpDialog="false" label="{@i18n>poActionItemHistoryActionItem}"></smartFilterBar:ControlConfiguration>
            <smartFilterBar:ControlConfiguration key="DUE_DATE" index="3" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false"
                controlType="date" filterType="interval" label="{@i18n>poActionItemHistoryDueDate}"></smartFilterBar:ControlConfiguration>
            <smartFilterBar:ControlConfiguration key="ACTUAL_COMPLETION_DATE" index="3" visibleInAdvancedArea="true"
                preventInitialDataFetchInValueHelpDialog="false" controlType="date" filterType="interval"
                label="{@i18n>poActionItemHistoryActualCompletionDate}"></smartFilterBar:ControlConfiguration>
        </smartFilterBar:controlConfiguration>
    </smartFilterBar:SmartFilterBar>
    <smartTable:SmartTable id="actionItemHistoryTable" entitySet="VTicketPOActionItemHistory" smartFilterId="actionItemHistoryFilterBar"
        useExportToExcel="false" useVariantManagement="false" useTablePersonalisation="true" tableType="ResponsiveTable"
        header="{i18n>poActionItemHistory}" showRowCount="true" persistencyKey="actionItemHistoryST_persis" enableAutoBinding="false"
        demandPopin="true" class="sapUiResponsiveContentPadding"
        requestAtLeastFields="PO_NUMBER,TICKET_ID,ACTION_ITEM_ID,DUE_DATE,COMMENT,ACTUAL_COMPLETION_DATE,ACTION_ITEM">
        <Table id="articlecoretable" growing="true" growingThreshold="10" mode="MultiSelect" sticky="ColumnHeaders">
            <!--sticky="ColumnHeaders"-->
            <columns>
                <Column id="TICKET_ID" hAlign="Begin">
                    <customData>
                        <core:CustomData key="p13nData" value='\{"columnKey": "TICKET_ID", "columnIndex":"0", "leadingProperty": "TICKET_ID"}'/>
                    </customData>
                    <Text text="{@i18n>poActionItemHistoryTicketId}"/>
                </Column>
                <Column id="DUE_DATE" hAlign="Begin">
                    <customData>
                        <core:CustomData key="p13nData" value='\{"columnKey": "DUE_DATE", "columnIndex":"3", "leadingProperty": "DUE_DATE"}'/>
                    </customData>
                    <Text text="{@i18n>poActionItemHistoryDueDate}"/>
                </Column>
                <Column id="ACTUAL_COMPLETION_DATE" hAlign="Begin">
                    <customData>
                        <core:CustomData key="p13nData"
                            value='\{"columnKey": "ACTUAL_COMPLETION_DATE", "columnIndex":"4", "leadingProperty": "ACTUAL_COMPLETION_DATE"}'/>
                    </customData>
                    <Text text="{@i18n>poActionItemHistoryActualCompletionDate}"/>
                </Column>
                <Column id="STATUS" hAlign="Begin">
                    <customData>
                        <core:CustomData key="p13nData" value='\{"columnKey": "STATUS", "columnIndex":"5", "leadingProperty": "STATUS"}'/>
                    </customData>
                    <Text text="{@i18n>poActionItemHistoryStatus}"/>
                </Column>
            </columns>
            <items>
                <ColumnListItem type="Active">
                    <cells>
                        <Text text="{parts: [{path: 'TICKET_ID'}],formatter: '.formatNumericString'}"/>
                        <Text text="{parts: [{path: 'DUE_DATE'}],formatter: '.formatter.formatDatetoDisplay'}"/>
                        <Text text="{parts: [{path: 'ACTUAL_COMPLETION_DATE'}],formatter: '.formatter.formatDatetoDisplay'}"/>
                        <core:Icon src="sap-icon://alert" class="iconClass" tooltip="{i18n>ammendment_tooltip}"></core:Icon>
                    </cells>
                </ColumnListItem>
            </items>
        </Table>
    </smartTable:SmartTable>
</core:FragmentDefinition>

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

This was resolved when I add the id of the Smart Filter Bar which was created in the dom as the smartFilterId property of the Smart Table

<smartTable:SmartTable id="actionItemHistoryTable" smartFilterId="poLineReInspectionHistoryFrag--actionItemHistoryFilterBar" >

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

did you use adddependent for your fragment?

0 Kudos

Yes I've added it as a dependent

this.getView().addDependent(that.oHistoryDialog);

junwu
Active Contributor
0 Kudos

even no request calling, how you get the data?

0 Kudos

I've set the default model in the manifest.
And when I place the smart table and filter in the parent view instead of the dialog it works