0

Is it possible to use a URL parameter as a property binding in UI5?

My problem is that I want to have different OData collections placed in the same UI5 aggregation. For example let's say I've "/Car("Mustang")/parts" and "/Car("Whatever")/parts". Both of them can be placed in the same view.

The application's URL contains the keyword like http://something/#/carMustang. This URL is coming from a routing pattern like "car{carHandle}".

How am I supposed to do stuff like this:

<List items="{/Car({carHandle})/parts}">
 <StandardListItem title={someProperty}>
 </StandardListItem>
</List>

So what would be the best practice to do this? I would like to avoid nasty fiddles in the controller.

4

1 回答 1

1

在您看来:

<List id="parts" items="{parts}">
   <StandardListItem title="{someProperty}"/>
</List>

在对匹配路由做出反应的控制器代码中:

var carHandle = event.getParameter("carHandle");
this.byId("parts").bindObject("/Car/" + carHandle);
于 2015-05-21T14:15:15.937 回答