【发布时间】:2012-03-15 12:45:14
【问题描述】:
我有一个包含产品信息的数据表页面,在产品选择操作中,我通过参数重定向到产品信息页面:
configurableNavigationHandler.performNavigation("productInfo?faces-redirect=true&prId=" + selectedCpl.getP().getPrId());
在我的 init 方法中的 viewscoped bean 中,我获取请求参数并填充所需的对象:
@ManagedBean
@ViewScoped
public class ProductInfo implements Serializable {
private Product p;
private Integer prId;
@PostConstruct
private void init() {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
if (request.getParameter("prId") != null) {
prId = Integer.parseInt(request.getParameter("prId"));
p = pf.find(prId);
在我的 productInfo.xhtml 上,我有一个产品信息视图和一个用于编辑产品信息的对话框,但是当我按下提交时,我的请求参数为空:
<p:commandButton styleClass="button-edit" value="Submit" actionListener="#{productInfo.saveProduct()}" update="prodInfo" oncomplete="dlg.hide();"/>
我正在使用带有 primefaces 元素的 jsf 2.0。
谁能帮帮我?谢谢。
【问题讨论】:
标签: jsf-2