擁有一個帶有ADF的基本JSF項目,它需要從表中刪除一行(每行都是Album
),並在請求行旁邊具有刪除按鈕(每一行都有一個)。
使用JDeveloper與ADF嘗試(嘗試這種解決方案也只用簡單的JSF :(How can I pass selected row to commandLink inside dataTable?) 然而,在我看來,setPropertyListener
和setPropertyActionListener
不調用(把一些虛擬的評論在setCommon()
功能,沒見過,也美麗評論從del_action()
沒有顯示)也試用@SessionScoped
豆
主要問題:什麼地方出錯,即使價值傳遞不起作用?
任何想法將不勝感激(並缺少語法突出,仍然是一個新手,還沒弄明白:) :)af:setPropertyListener不工作,調用(也不是f:setPropertyActionListener)
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>
輔助Bean:
@ManagedBean(name="backing_main") @ViewScoped ... private String common; public void setCommon(String common){ System.out.print("!!!SET!!!!!"); this.common = common; } public String getCommon(){ return this.common; } public void del_action() { System.out.print("!!!!!!!!!!!!!!!!Delete1"); } public static class Album{ String artist; String albumName; //constructor, setter, all the expected stuff }
函數del_action()需要返回一個字符串! –