有一个带有 ADF 的基本 JSF 项目,它需要从表中删除一行(每一行都是一个Album),并在请求的行旁边有一个 Delete 按钮(每一行都有一个)。
使用 JDeveloper 尝试使用 ADF(仅使用简单的 JSF 也尝试了此解决方案:(如何将选定的行传递给 dataTable 中的 commandLink?)但是,在我看来,setPropertyListener并setPropertyActionListener没有调用(在setCommon()函数中放置一些虚拟注释,没有看到, 也是del_action()未显示的漂亮评论). 也尝试了@SessionScopedbean.
主要问题:出了什么问题,即使是值传递也不起作用?
任何想法都将受到高度赞赏(对于缺乏语法高亮表示抱歉,仍然是新手,还没想出来):)
JSF 部分:
<af:column sortable="false" headerText=" " align="start" id="c4">
<h:commandButton value="Delete" id="del" action="#{backing_main.del_action}">
<af:setPropertyListener to="#{backing_main.common}" from="#{row.albumName}" type="action" />
</h:commandButton>
</af:column>
支持豆:
@ManagedBean(name="backing_main")
@ViewScoped
...
私有字符串通用;
公共无效setCommon(字符串公共){
System.out.print("!!!SET!!!!!");
this.common = 普通;
}
公共字符串 getCommon(){
返回 this.common;
}
公共无效del_action(){
System.out.print("!!!!!!!!!!!!!!!!Delete1");
}
公共静态类相册{
弦乐艺术家;
字符串专辑名;
//构造函数,setter,所有预期的东西
}