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如果有办法让代码更具可读性,我是这个网站的新手