Search code examples
jsfjsf-2primefaces

Datatable selection not working


When I select a row in my primefaces datatable the row highights, but the selection event is not being invoked and the selected row data is not going to it. Also I notice that my eclipse debugger seems to just hang with PrimeFaces, anyone else notice this? Below is my .xhtml.

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"  
       xmlns:ui="http://java.sun.com/jsf/facelets" 
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:p="http://primefaces.org/ui" 
     >
<h:head>
    <h:outputStylesheet library="css" name="table-style.css"  />
</h:head>

<h:body>
<center>

<p:dataTable var="user" value="#{customer.getCustomerList()}"  
         selection="#{customer.selectedCustomer}" selectionMode="single"  
         rowSelectListener="#{custmoer.onUserSelect}" onRowSelectUpdate="userUpdateForm"
          onRowUnselectUpdate="userUpdateForm"
         paginator="true" rows="5" rowKey="#{user.customerID}" >

            <p:column>  
                <f:facet name="header">  
                    <h:outputText value="Id" />  
                </f:facet>  
                <h:outputText value="#{user.customerID}" />  
             </p:column>  

             <p:column > 

             <f:facet name="header">  

                <h:outputText value="Name" />  

             </f:facet>  

             <h:outputText value="#{user.name}" />  

             </p:column>  
            <p:column >  

             <f:facet name="header">  

                <h:outputText value="Address" />  

             </f:facet>  

             <h:outputText value="#{user.address}" />  

             </p:column>  

     </p:dataTable>  

    <p:inputText id="userUpdateForm" value="#{customer.selectedCustomer.name}" /> 
    </h:form>
    </center>
</h:body>


Solution

  • Seems the problem was IE9. Problem disappeared with Firefox.