Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml SAPUI5将下拉框的值绑定到另一个控件的属性_Xml_View_Sapui5 - Fatal编程技术网

Xml SAPUI5将下拉框的值绑定到另一个控件的属性

Xml SAPUI5将下拉框的值绑定到另一个控件的属性,xml,view,sapui5,Xml,View,Sapui5,我是sapui5新手,我正在尝试根据表达式绑定中下拉框的选定项/键设置textarea的可见性 我的部分看法是: <DropdownBox id="cboId" editable="true" rows="50" cols="50" /> <TextArea id="areaId" visible="{= ${#cboId}.getSelectedKey() === 1 }" /> 我知道语法不正确,但它给出了我想如何使用绑定的线索 甚至可以在xml视

我是sapui5新手,我正在尝试根据表达式绑定中下拉框的选定项/键设置textarea的可见性

我的部分看法是:

   <DropdownBox id="cboId" editable="true" rows="50" cols="50" />
    <TextArea id="areaId" visible="{= ${#cboId}.getSelectedKey() === 1 }" />

我知道语法不正确,但它给出了我想如何使用绑定的线索


甚至可以在xml视图中绑定一个选择吗?

只需向下拉框的更改事件添加一个eventhandler即可

XML:


感谢您的努力,但这是一个直截了当的解决方案,我不想为像这样的“简单”任务编写EventHandler,我可以在问题中提到;)
<DropdownBox id="cboId" editable="true" rows="50" cols="50" change= "eventhandler"/>
    <TextArea id="areaId" />
eventhandler : function({
this.getView().byId("areaId").setVisible(
     this.getView().byId("cboId").getSelectedKey() === 1)
)
}