Skip to Content
0

Issue with Icontabbar binding to display in multiple icontabfilter

Feb 20, 2017 at 09:48 AM

290

avatar image

Hi All,

I'm working on Fiori-Like application. In Splitscreen, detail view has Icontabbar control with multiple IcontabFilter. When i bind the oData to the Icontabbar it shows only single icontabfilter and the other one is not visible in the view. how to overcome this. pls suggest some idea.

Code:

View.XML

<IconTabBar id="idIconTabBarcib" select="handleIconTabBarSelecta" items="{/PENDING_DETAILS_EMP_INFOSet}">

<items>

<IconTabFilter icon="sap-icon://customer-briefing" id="cb31a" visible="true">

<l:Grid> <l:content>

<Label text="Personnel Numb"/>

<ObjectNumber number="{EmpNo}"/> </l:content> </l:Grid>

<l:Grid> <l:content> <Label text="Personnel Sub Area"/>

<ObjectNumber number="{Psa}"/> </l:content> </l:Grid>

<l:Grid> <l:content> <Label text="Cost Center"/> <ObjectNumber number="{CostCentre1}"/> </l:content> </l:Grid>

</IconTabFilter>

<IconTabFilter icon="sap-icon://customer-briefing" id="cb31a" visible="true">

<l:Grid> <l:content>

<Label text="Personnel Area"/>

<ObjectNumber number="{EmpName}"/> </l:content> </l:Grid>

<l:Grid> <l:content> <Label text="Personnel Sub Area"/>

<ObjectNumber number="{Psa}"/> </l:content>

</l:Grid> <l:Grid>

<l:content> <Label text="Cost Center"/> <ObjectNumber number="{CostCentre}"/> </l:content> </l:Grid>

</IconTabFilter>

</items>

</IconTabBar>

Controller Page:

var pag=this.byId("idIconTabBarcib")

var oFilters = [new sap.ui.model.Filter("ImPernr", sap.ui.model.FilterOperator.EQ, EmpId), new sap.ui.model.Filter("ImWiid", sap.ui.model.FilterOperator.EQ, WrkId)]; var bnd = pag.getBinding("items").filter(oFilters);

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Akhilesh Upadhyay Feb 20, 2017 at 10:35 AM
0

I think you are defining same id for both icontabfilter, remove that for both and check or remove/change for at least one, thats not needed i guess,

id="cb31a"


Thanks,

Akhilesh

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Akilesh,

Thanks for your rply but still i'm facing the same issue. It displays only one IconTabFilter. I have 4 or 5 IconTabFilters to be displayed here :(

0

Hi,

There might be the chance that you are getting single record from backend. and

I guess your XML template itself is wrong, only one tabFilter should be there in xml, Since, you are binding items to IconTabBar, so only one template should be there in xml and number of tabFilter will be created automatically as many number of records coming from backend. something like below:

<IconTabBar id="idIconTabBarcib" select="handleIconTabBarSelecta" items="{/PENDING_DETAILS_EMP_INFOSet}">
    <items>
        <IconTabFilter icon="{iconFromBackend}" text="{text}" visible="true">
            <l:Grid>
                <l:content>
                    <Label text="Personnel Numb" />
                    <ObjectNumber number="{EmpNo}" />
                </l:content>
            </l:Grid>
            <l:Grid>
                <l:content>
                    <Label text="Personnel Sub Area" />
                    <ObjectNumber number="{Psa}" />
                </l:content>
            </l:Grid>
            <l:Grid>
                <l:content>
                    <Label text="Cost Center" />
                    <ObjectNumber number="{CostCentre1}" />
                </l:content>
            </l:Grid>
        </IconTabFilter>
    </items>
</IconTabBar>

and your data would be different like nested data, for each filter tab you will have another set of record in the main data.

in order to bind different data set (entity) to each tabFilter, then your current use case is not correct, you can bind tabFilter indivisually but not into aggregation.

pls check this basic example may help you.

Thanks,

Akhilesh

1