1

I've been able to successfully bind a DropDown control in SAPUI5 to list values based on one model. My questions is: how do I bind a DropDown to one model that contains all possible values and one model that contains the actual value for that record?

Example:

Table (and first Model)

Name School

John Hopkins

Mary Horner

The school column is a DropDown, if I bind the DropDown to this model these are the only two schools that show up when in actuality there are five possible schools to choose based on the following model:

Second Model

School

  • American
  • Hopkins
  • Horner
  • Thornton
  • Walters

Thought this would be simple, but haven;t been able to figure it out or find an example with searches.

4

1 回答 1

4

我不太确定我是否完全理解您想要做什么,但是您可以轻松地将 selectedKey 属性绑定到与填充项目的模型不同的模型:

我为您创建了一个示例:http: //jsbin.com/qipedoyufa/12/edit ?html,js,output

路径指向相同的模型还是不同的模型都没有关系。我使用命名模型并将模型名称放在路径前面,用“>”分隔。一个名为“x”且路径为“/a/b/c”的模型变为“x>/a/b/c”。

更新:我想我现在知道你的意思了,这是表格中的一个例子:http: //jsbin.com/tefijezete/2/edit ?html,js,output

于 2015-01-12T08:15:33.767 回答