Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java <;p:dataTable>;行选择_Java_Jsf_Primefaces - Fatal编程技术网

Java <;p:dataTable>;行选择

Java <;p:dataTable>;行选择,java,jsf,primefaces,Java,Jsf,Primefaces,这是我的密码 <p:dataTable id="customerTable" var="customer" widgetVar="customerTableVar" value="#{customerFacade.findAll()}" selectionMode="single"

这是我的密码

<p:dataTable id="customerTable" var="customer" 
                             widgetVar="customerTableVar"
                             value="#{customerFacade.findAll()}"
                             selectionMode="single"
                             rowKey="#{customer.customerid}"
                             selection="#{editCustomerBean.customer}"
                             paginator="true" rows="10"  
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                             rowsPerPageTemplate="5,10,15">  
<p:ajax event="rowSelect" listener="#{customerBean.onRowSelect}"   
                            update=":form:growl" /> 

我想在选择行时显示一个命令按钮

这是我的命令按钮

我试图修改
,但什么也没发生 这是我修改过的

<p:ajax event="rowSelect" listener="#{customerBean.onRowSelect}"   
                            update=":form:growl" oncomplete="editBut.show()"/>

有人能告诉我怎么做吗


非常感谢

您的按钮在代码中的什么位置?请包括按钮的代码以及托管bean代码这是我的命令按钮Customer bean@Named(value=“customerBean”)@RequestScoped公共类customerBean{private Customer Customer;public customerBean(){Customer=new Customer();}public Customer getCustomer(){return Customer;}public void onRowSelect(SelectEvent event){FacesMessage msg=new FacesMessage(“客户已选”),((客户)event.getObject()).getPhone();FacesContext.getCurrentInstance().addMessage(null,msg);}public void setCustomer(客户客户){this.Customer=Customer;}}Edit customerbean@Named(value=“editCustomerBean”)@SessionScoped公共类editCustomerBean实现可序列化的{private Customer Customer;public Customer getCustomer(){return Customer;}public void setCustomer(客户客户){this.customer=customer;}public EditCustomerBean(){}}sry如果有办法让代码更具可读性,我是这个网站的新手