Xml SAPUI5将下拉框的值绑定到另一个控件的属性
我是sapui5新手,我正在尝试根据表达式绑定中下拉框的选定项/键设置textarea的可见性 我的部分看法是: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视
<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)
)
}