2012-06-07 87 views
3

錶行我有一個這樣的表:取消選擇在PrimeFaces

<p:dataTable id="table" selectionMode="single"> 

    ... 

    <p:ajax event="rowSelect" listener="#{myBean.onRowSelect}" update="someStuff"/> 
    <p:ajax event="rowUnselect" listener="#{myBean.onRowUnselect}" update="otherStuff"/> 

</p:dataTable> 

有誰知道如何觸發對UI的rowUnselect事件?

另一件事,selectionMode屬性的可能值是什麼?他們似乎沒有在文檔中。

感謝,

回答

4

要觸發rowUnselect,一旦選擇了行,按住Ctrl鍵,再單擊行。這樣行就會被取消選中,並執行ajax事件。

selectionMode屬性的可能值爲「single」和「multiple」。

+0

但是,如果selectionMode是單個,並且您有一個radioButton列,則不能通過Ctrl +單擊取消選擇radioButton。 – Pino