on 2015 Sep 11 1:15 PM
i have items from an association bound to a Table.
if i do it in this way it works:
<Table id="tbl1" items="{layerCompAss}" headerText="header" growing="true" >
but i need to add a Filter to this table and i tried it in this way:
<Table id="tbl1"
items="{
path: '/layerCompAss',
filters: [{
Comptyp: 'H'
}]
}"
headerText="header" growing="true" >
but this does not work.
Any idea how that works?
Thanks
thanks, but it is still not working.
for me the problem seems to be that items="{layerCompAss}" is not the same than
items="{ path:'/layerCompAss' }"
any idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i try to explain it in detail:
my view looks like this:
<List backgroundDesign="Transparent" items="{itemLayerAss}" id="componentList" growing="true">
<CustomListItem>
<Table id="SchleifmittelKomponenten" items="{layerCompAss}" | headerText="Schleifmittel" growing="true> //Table Content |
</Table>
</CustomListItem>
</List>
Both Entitys are Associations ( itemLayer Ass and LayerCompAss )
What i want to do is to add a Filter to the second Table ( with Binding layerCompAss ) due to the fact that it is much easier with association entities i want to filter at the xml view instead of filtering at the context.
but if i try it in this way:
<Table id="SchleifmittelKomponenten" items="{
path: '/layerCompAss',
filters: [{
Comptyp: 'H'
}]
}" headerText="Schleifmittel" growing="true" >
the model trys to resolve the path <service path>/layerCompAss instead of <service path>/relatedEntity of base table/layerCompAss.
is there no way to handle this via the xml view?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Philipp,
Please specify filter as below:
<Table id="SchleifmittelKomponenten"
items="{path: '/layerCompAss',filters: [{ path: 'Comptyp', operator: 'Contains', value1: 'H'}] }" growing="true" >
If it is one level below the item association specify as below
<Table id="SchleifmittelKomponenten"
items="{path: '/layerCompAss',filters: [{ path: 'Association2/Comptyp', operator: 'Contains', value1: 'H'}] }" growing="true" >
Hope it helps!
Thanks,
Mona
hi,
the issue is not with the filters - the issue is that the association does not work anymore.
this is the association definition:
<Association Name="layerComp" sap:content-version="1">
<End Type="/TYED/CA_OSKAR_SRV.layer" Multiplicity="*" Role="FromRole_layerComp"/>
<End Type="/TYED/CA_OSKAR_SRV.comp" Multiplicity="*" Role="ToRole_layerComp"/>
<ReferentialConstraint>
<Principal Role="FromRole_layerComp">
<PropertyRef Name="Matnr"/>
<PropertyRef Name="Aufnr"/>
<PropertyRef Name="Laynr"/>
</Principal>
<Dependent Role="ToRole_layerComp">
<PropertyRef Name="Matnr"/>
<PropertyRef Name="Aufnr"/>
<PropertyRef Name="Laynr"/>
</Dependent>
</ReferentialConstraint>
</Association>
but as soon as i use it within the path attribute it does not work anymore.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<Table items = "{path : '/Tracks', filters: [{ path: 'MyApprovals', operator: 'EQ', value1: 'true'}] }"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you need to add filters with ui.model.filter like below,
items: {
path: "metadatamodel>/allprojects",
template: new sap.ui.core.ListItem({
text: "{metadatamodel>projectDescription}",
key: "{metadatamodel>projectKey}"
}),
filters: [new sap.ui.model.Filter("projectClient", sap.ui.model.FilterOperator.EQ, "{tablemodel>client}")]
}
check this link-https://github.com/SAP/openui5/issues/130
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.