Skip to Content
0

Unique values for table filter

Oct 05, 2017 at 06:43 AM

32

avatar image
Former Member

Hi all,

I have a xml model like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Rowset>
    <Row>
        <Site>Site1</Site>
        <Area>Area1</Area>
        <WorkUnit>02001</WorkUnit>
    </Row>
    <Row>
        <Site>Site1</Site>
        <Area>Area1</Area>
        <WorkUnit>02002</WorkUnit>
    </Row>
    <Row>
        <Site>Site1</Site>
        <Area>Area2</Area>
        <WorkUnit>05004</WorkUnit>
    </Row>
    <Row>
        <Site>Site2</Site>
        <Area>Area3</Area>
        <WorkUnit>05004</WorkUnit>
    </Row>
</Rowset>

This model is bound to my table. Working still fine so far.

But now I have also filter options for this table:

<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout">
    <ViewSettingsDialog confirm="_onPressViewSettingsOk" id="viewSettingsDialog">
        <filterItems>
            <ViewSettingsFilterItem text="Site" key="Site" items="{SamplingResources>/Row/}">
                <items>
                    <ViewSettingsItem text="{SamplingResources>Site}" key="Site___{SamplingResources>Site}"></ViewSettingsItem>
                </items>
            </ViewSettingsFilterItem>
            <ViewSettingsFilterItem text="{Area}" key="Area" items="{SamplingResources>/Row/}" >
                <items>
                    <ViewSettingsItem text="{SamplingResources>Area}" key="Area___{SamplingResources>Area}"></ViewSettingsItem>
                </items>
            </ViewSettingsFilterItem>
            <ViewSettingsFilterItem text="{Unit}" key="WorkCenter" items="{SamplingResources>/Row/}" >
                <items>
                    <ViewSettingsItem text="{SamplingResources>WorkUnit}" key="WorkCenter___{SamplingResources>WorkCenter}"></ViewSettingsItem>
                </items>
            </ViewSettingsFilterItem>
        </filterItems>
    </ViewSettingsDialog>
</core:FragmentDefinition>

There are duplicate entries in the xml file and of course they are also displayed in the filter dialog. How can I remove these entries to get only a distinct list?

gm3ic.png (8.6 kB)
ywclc.png (29.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers