admin管理员组文章数量:1022705
The dokumentation of sap.m.CustomListItem says that CustomListItem hat a press
event.
I created a site with the press event on a list item, and another press event on a Button inside the list item. The button works fine. A click on the list item shows nothing. Not even an error.
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
press: function(){
alert("Clicked the list item");
}
});
Here is an example: ,output
The dokumentation of sap.m.CustomListItem says that CustomListItem hat a press
event.
I created a site with the press event on a list item, and another press event on a Button inside the list item. The button works fine. A click on the list item shows nothing. Not even an error.
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
press: function(){
alert("Clicked the list item");
}
});
Here is an example: http://jsbin./pozeve/4/edit?html,output
Share Improve this question asked Dec 17, 2014 at 12:13 DerZyklopDerZyklop 3,8232 gold badges22 silver badges28 bronze badges 01 Answer
Reset to default 4This is a frequent issue people face when they´re using List controls. There´s an answer to this here.
To put it in a nutshell, you either have to add a type
property to your CustomListItem
:
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
type : sap.m.ListType.Active,
press: function(){
alert("Clicked the list item");
}
});
or a mode
property to your sap.m.List
. For a parison see the answer mentioned above.
The dokumentation of sap.m.CustomListItem says that CustomListItem hat a press
event.
I created a site with the press event on a list item, and another press event on a Button inside the list item. The button works fine. A click on the list item shows nothing. Not even an error.
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
press: function(){
alert("Clicked the list item");
}
});
Here is an example: ,output
The dokumentation of sap.m.CustomListItem says that CustomListItem hat a press
event.
I created a site with the press event on a list item, and another press event on a Button inside the list item. The button works fine. A click on the list item shows nothing. Not even an error.
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
press: function(){
alert("Clicked the list item");
}
});
Here is an example: http://jsbin./pozeve/4/edit?html,output
Share Improve this question asked Dec 17, 2014 at 12:13 DerZyklopDerZyklop 3,8232 gold badges22 silver badges28 bronze badges 01 Answer
Reset to default 4This is a frequent issue people face when they´re using List controls. There´s an answer to this here.
To put it in a nutshell, you either have to add a type
property to your CustomListItem
:
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
type : sap.m.ListType.Active,
press: function(){
alert("Clicked the list item");
}
});
or a mode
property to your sap.m.List
. For a parison see the answer mentioned above.
本文标签: javascriptEvent quotpressquot on sapmCustomListItem doesn39t workStack Overflow
版权声明:本文标题:javascript - Event "press" on sap.m.CustomListItem doesn't work - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745520816a2154306.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论