在操作中更新的JSF注入的支持bean属性为null

时间:2013-06-27 07:16:25

标签: primefaces datatable

我在其他bean中注入bean selectOfferMpans

@ManagedProperty(value="#{selectOfferMpans}")
private SelectOfferMpans selectOfferMpans;    

public void setSelectOfferMpans(SelectOfferMpans selectOfferMpans) {
    this.selectOfferMpans = selectOfferMpans;
}

如果我在第二个bean的selectOfferMpans.selectedSites中询问@PostConstruct的值,调试器会说它为空。

此属性已在1.xhtml

的此操作中更新
<p:commandButton id="pCBFind" styleClass="centerAbs" type="submit" icon="ui-  icon-search" value="#{text['selectOfferMpans.find']}" actionListener="#{selectOfferMpans.findCustomer}" update="CustomerData,CustomerSites" oncomplete="expandAll();"/>

然后当用户单击此按钮时,应用程序从1.xhtml导航到2.xhtml

p:commandButton id="pCBCreateOffer" type="submit" icon="ui-icon-check" value="#{text['selectOfferMpans.newOffer']}"
                    action="#{selectOfferMpans.goToOffers}"/>
来自bean1的

代码

public String goToOffers(){
        try{

            JSFHelper.addParamToRequest(SofycParamNames.CUSTOMER_ID,   customerfound.getCustomerId());
        JSFHelper.addParamToRequest(SofycParamNames.OPTION, this.getMenuOrigin());
        return SofycNavigation.VIEW_CREATE_OFFERS_PAGE;

    } catch (Throwable t) {
        log.error("goToOffers:", t);
        JSFHelper.addErrorMessage(ID_OFFER_SELECT_MPANS_FORM, "Error navigating to offers page");            
        return null;
    }
}                  

我错过了什么?

0 个答案:

没有答案