I have the following scenario:
<Table
id="priceListsTable"
items="{path : 'myModel>/PriceLists', templateShareable : false}">
<columns>
<Column>
<Text text="Name"/>
</Column>
<Column>
<Text text="Base Price List"/>
</Column>
</columns>
<ColumnListItem>
<Text text="{myModel>NAME}"/>
<Select
id="basePriceList"
items="{myModel2>/PriceLists}"
selectedKey="{path:'myModel>BASE_PRICE_LIST_ID', type:'sap.ui.model.odata.type.String'}">
<core:ListItem key="{myModel2>ID}" text="{myModel2>NAME}"/>
</Select>
</ColumnListItem>
</Table>
I'm displaying a price list collection, and every price list has a base price list linked to itself with conversion factor. So, 'items' path of priceListsTable is the same as 'items' path of basePriceList . Is there a way to loop all price lists in basePriceList using myModel and not defining myModel2.
Right now i'm doing it like this in onInit():
this.getView().setModel(this.getOwnerComponent().getModel("myModel"),"myModel2");
Actually, duplicating the model just to use it for Select.
I appreciate any help.
Best regards,
Ebu
Request clarification before answering.
I think you are fine. you are not duplicating the model, you just have two alias name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.