主页.xhtml
<p:button outcome="product" value="Login Simple Button"/>
<p:commandButton value="Login" action="#{homeController.validate}" update="logindialog"/>
产品.xhtml
<f:metadata> <f:viewAction action="#{productController.readProductGroup}" /> </f:metadata>
简单的 p:button 导航并成功调用 readProductGroup(); 但是即使 homeController.validate() 方法返回 'product' 并成功导航到 product.xhtml,p:commandButton 也不会。
使用 p:button,我无法灵活地调用服务器方法、使用我需要的更新属性等。
我需要的是,能够在 home.xhtml 页面按钮中使用更新、action/actionListener 等属性,同时在导航到 product.xhtml 时,应该能够调用 f 下的函数 productController.readProductGroup:页面加载时的元数据。
请建议。