SAPUI5:如何更新SelectedKey上的显示更改?

时间:2017-12-26 01:10:33

标签: sapui5 html-select

我的显示信息有问题。 我需要设置Drop box.

中的值

来自clothing.json的代码

{
  "catalog": {
    "clothing": {
      "categories": [
        {"name": "Women", "categories": [
          {"name":"Clothing", "categories": [
            {"name": "Dresses", "categories": [
              {"name": "Casual Red Dress", "amount": 16.99, "currency": "EUR", "size": "S"},
              {"name": "Short Black Dress", "amount": 47.99, "currency": "EUR", "size": "M"},
              {"name": "Long Blue Dinner Dress", "amount": 103.99, "currency": "USD", "size": "L"}
            ]},

来自View.xml的代码

<Column id="colSize" width="11rem">
  <m:Label text="Size"/>
  <template>
     <m:Select
        id = "selSize"
        selectedKey="{size}"
        items="{path: '/sizes', templateShareable: true}"
        visible="{= !!${size}}"
        forceSelection="false">
        <core:Item key="{key}" text="{value}"/>
      </m:Select>
   </template>
 </Column>

并将Controller.js

中的代码分开
    onPressBtnSetSize: function() {
        var oComboBox = this.byId("cbxSelectSize"),
            sKey = oComboBox.getSelectedItem().getKey(),
            oSelect = this.byId("selSize");
            oSelect.setSelectedKey(sKey);       
    }

现在,当我调用方法getSelectedKey()时。我理解了sKey的含义。 但表中的显示不会改变。

我认为您需要更新或刷新表格。但我所有的尝试都失败了。请帮助!

1 个答案:

答案 0 :(得分:-1)

-webkit-transition: transform 2s ease-in-out;
transition: transform 2s ease-in-out;