Continuous rowselect row example in ver 3.3

I have this code. It should fire the rowSelect event after the user selects a row and closes the dialog box. it worked fine before I upgraded to primfaces 3.3 (I had ver3.2). I have no exception in the console, and when I debug, I see that the method does not call. I do not know where to start this problem. Can anyone help me with this?

<p:dialog id="dlg" closable="true" header="New reciever" widgetVar="receiverListDlg" visible="false" modal="true"> <p:dataTable var="reciever" value="#{transactionController.recieverList}"> <p:ajax event="rowSelect" listener="#{transactionController.onRowSelect}" update=":form" onsuccess="receiverListDlg.hide()" /> <f:facet name="header"> Previouse recievers for #{customer.firstName} </f:facet> <p:column selectionMode="single" /> <p:column headerText="#{msg.havale_customer_firstname}"> <h:outputText value="#{reciever.firstName}" /> </p:column> <p:column headerText="#{msg.havale_customer_lastName}"> <h:outputText value="#{reciever.lastName}" /> </p:column> <p:column headerText="#{msg.havale_customer_phoneNr}"> <h:outputText value="#{reciever.phoneNr}" /> </p:column> </p:dataTable> </p:dialog> 
+6
source share
4 answers

Now Primefaces has provided some new ajax events:

  • onSelectCheckBox
  • onUnselectCheckbox
  • onSelectRadio

So rowSelect and rowUnselect will not run in your case.

+7
source

I think you should use the ajax event "rowSelectRadio".

+3
source

The DataTable value must be surrounded by <h:form> . You should also add the following attributes to p: dataTable (I don't know if all of them are needed, but I have everything and everything works fine).
- selectionMode="single"
- rowKey="#{receiver.id }" (replace 'id' with the actual attribute of the recipient identifier)
- selection="#{transactionController.selectedReceiver"

+2
source

I am new to stackoverflow as a user, but I often use it because I saw something happening here with Prime! ;-)
Ok, now I am transferring the RichFaces 3.3.3 JSF 1.2 project to Mojarra 2.1.7 (SNAPSHOT 20120206) and PrimeFaces 3.3, which is an IMHO revelation for JSF.
In short, I looked for this error, mentioned in the topic for half a week, and I gave it an attempt to return to PF 3.2 and tataaaa rowSelect, and now all my other implementations work.
I have a simple form with datatable and selectionMode = "multiple" and ajax data:

  <h:form> <p:dataTable id="massnahmenAuswahl" value="#{massnahmenController.massnahmen}" var="eineMassnahme" selection="#{massnahmenController.massnahmenSelected}" rowKey="#{eineMassnahme.massnahme}"> <p:ajax event="rowSelect" listener="#{massnahmenController.rowSelected}" process="@this" update="@this" /> <p:ajax event="rowUnselect" listener="#{massnahmenController.rowUnselected}" process="@this" update="@this" /> <p:ajax event="toggleSelect" listener="#{massnahmenController.rowToggleSelected}" process="@this" update="@this" /> <p:column selectionMode="multiple" style="width:18px" disabledSelection="#{!login.editable}" styleClass="checkbox" /> <p:column> <h:outputText escape="false" value="#{eineMassnahme.zeile}" /> </p:column> <p:column> <h:outputText escape="false" value="#{eineMassnahme.bezeichnung}" /> </p:column> <p:column> <fiona:labelImgGA for="#{eineMassnahme.massnahme}" /> </p:column> <p:column> <p:selectBooleanCheckbox value="#{eineMassnahme.vorjahr}" disabled="true" /> </p:column> <f:facet name="footer"> <p:commandButton value="Speichern" action="#{massnahmenController.speichern}" disabled="#{!login.editable}" process="@this" update="@form" /> <p:spacer/> <p:commandButton value="Weiter" action="#{massnahmenController.saveAndNext}" disabled="#{!login.editable}" process="@this" update="@form" /> </f:facet> </p:dataTable> </h:form> 

Will this be fixed in the near future? So far, I really do PF! Do not disappoint me !; -)

UPDATE:
The solution is to use lazy = true with PF 3.3. I saw this in question 2993 in the PrimeFaces problem tracking program!

0
source

Source: https://habr.com/ru/post/917511/


All Articles