SAPUI5:选择表中不工作的行项目
我构建了一个如下所示的XML片段SAPUI5:选择表中不工作的行项目,sapui5,Sapui5,我构建了一个如下所示的XML片段 <core:FragmentDefinition xmlns="sap.m" xmlns:fb="sap.ui.comp.filterbar" xmlns:core="sap.ui.core"> <Dialog stretch="false" title="Select User" showHeader="true"> <content> <fb:FilterBar reset="onRes
<core:FragmentDefinition xmlns="sap.m"
xmlns:fb="sap.ui.comp.filterbar" xmlns:core="sap.ui.core">
<Dialog stretch="false" title="Select User" showHeader="true">
<content>
<fb:FilterBar reset="onReset" search="onSearch"
advancedMode="true">
<fb:filterItems>
<fb:FilterItem id="searchField" name="userSeacrch">
<fb:control>
<SearchField width="100%" id="searchUser" showSearchButton="false"/>
</fb:control>
</fb:FilterItem>
</fb:filterItems>
<fb:filterGroupItems>
<fb:FilterGroupItem groupName="G1" id="fname1" idgroupTitle="Group1" name="A" label="First Name" labelTooltip="First Name">
<fb:control>
<Input type="Text" id="fname"/>
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="G1" id="lname1" groupTitle="Group1" name="B" label="Last Name" labelTooltip="Last Name">
<fb:control>
<Input type="Text" id="lname"/>
</fb:control>
</fb:FilterGroupItem>
<fb:FilterGroupItem groupName="G1" id="department1" groupTitle="Group1" name="C" label="Department" labelTooltip="Department">
<fb:control>
<Input type="Text" id="department"/>
</fb:control>
</fb:FilterGroupItem>
</fb:filterGroupItems>
</fb:FilterBar>
<Table id="idF4" inset="true"
backgroundDesign="Translucent"
visibleRowCount="5"
noDataText="No data exists" >
<headerToolbar>
<Toolbar>
<Label text="User(s)"></Label>
</Toolbar>
</headerToolbar>
<columns>
<Column>
<Text text="User" type="Navigation"/>
</Column>
<Column minScreenWidth="small" popinDisplay="Inline" demandPopin="true">
<Text text="First Name" type="Navigation" />
</Column>
<Column minScreenWidth="small" popinDisplay="Inline" demandPopin="true">
<Text text="Last Name" type="Navigation" />
</Column>
<Column>
<Text text="Department" type="Navigation"/>
</Column>
</columns>
<items>
<ColumnListItem type="Navigation" selected="true" press="handleLineItemPress">
<cells>
<Text />
<Text />
<Text />
<Text "/>
</cells>
</ColumnListItem>
</items>
</Table>
</content>
<beginButton>
<Button text="Cancel" press="onCloseDialog" />
</beginButton>
</Dialog>
</core:FragmentDefinition>
现在,当我从这个表中选择一个条目时,不会触发事件按下
我也有一个控制器代码
handleLineItemPress : function(oEvent){
var currentRowContext = oEvent.getParameter("rowContext");
},
真的吗
只要先好好看看你的代码
您已经定义了一个表-没有数据绑定-所以它只有一个ColumnListItem,并分配了一个press事件
在您的代码中,您正在向表中添加更多的ColumnListItem,并且这些列没有指定press事件
现在你问为什么这些行的新闻发布会不起作用-
另一方面,您不使用数据绑定的原因是什么
handleLineItemPress : function(oEvent){
var currentRowContext = oEvent.getParameter("rowContext");
},