我有一个原始数据表 显示记录的数量。
我要浏览到行选择事件上的另一页( 编辑选中的实体)
。
The closest sample/demo I could find was use the p:ajax tag to bind the rowSelect event to a listener method http://www.primefaces.org/showcase-labs/ui/datatableRowSelectionInstant.jsf
我还为同一份http://forum.primefaces.org/viewtop.php?f=3&t=14664 获得一篇文章。
我试图执行他们一样。 但也没有成功。
我正以这种方式尝试 并指导我 如果我错过了任何东西。
调
<p:dataTable var="product" value="#{addPatientBB.patientAddList}" paginator="true" rows="10" 调 selection="#{addPatientBB.pat}" selectionMode="single"> <p:ajax event="rowSelect" listener="#{addPatientBB.onRowSelect}" /> 调 <p:column> 调 <f:facet name="header"> 调调 <h:outputText value="FirstName" /> 调 </f:facet> 调 <h:outputText value="#{product.firstName}" /> 调 </p:column> 调 <p:column> 调 <f:facet name="header"> 调调 <h:outputText value="Email" /> 调 </f:facet> 调 <h:outputText value="#{product.email}" /> 调 </p:column> 调 <p:column> 调 <f:facet name="header"> 调调 <h:outputText value="Gender" /> 调 </f:facet> 调 <h:outputText value="#{product.gender}" /> 调 </p:column> </p:dataTable>
背豆是:
@ManagedBean
@ViewScoped
public class AddPatientBB implements Serializable
{
private Patient pat;
public Patient getPat()
{
System.out.println("tried to get pat");
return pat;
}
public void setPat(Patient pat)
{
this.pat = pat;
System.out.println("tried to set pat");
}
public void onRowSelect()
{
System.out.println("inside onRow select Method");
ConfigurableNavigationHandler configurableNavigationHandler = (ConfigurableNavigationHandler) FacesContext.getCurrentInstance().getApplication().getNavigationHandler();
System.out.println("navigation objt created");
配置导航操作器。 performation Navigation (“ Page? faces- redirect= true ”) ; 配置导航操作器。 格式化导航( “ Page? faces- redirect= true ” ) ;
// Page is my navigation page where I wish to navigate named as
// "Page.xhtml"
System.out.println("Navigation executed");
}
}
因此, 我如何浏览到行选择事件上的另一页? 如何在导航窗体后显示它的值 。
我可以用RowSelect () 方法进去, 事实上问题是他无法获得或理解这条路径:
配置导航操作器。 performation Navigation (“ Page? faces- redirect= true ”) ; 配置导航操作器。 格式化导航( “ Page? faces- redirect= true ” ) ;
so he is not able to print any logs after this line. why is it so? is it because of I am using Liferay?
普拉指导我。