2013-01-24 2 views
1

Primefaces로 프로그래밍 중입니다. P : wizard를 사용합니다.primefaces에서 p : wizard가 지우는 변수들

문제가 있습니다. 때 미안 내 모든 변수에 액세스 할 수 있습니다,하지만 난 panelGrid를 생성하기 위해 2 단계로 변경할 때, 1 단계에서 사용할 수 있었던 변수는 메소드의 CreateForm 지금 비어있는 단계 1 :

<p:wizard widgetVar="wiz"> 
    <p:tab id="stepone" title="Step 1"> 
     <p:panel> 
      <h:panelGrid > 
       <h:outputLink value="#" onclick="wiz.loadStep (wiz.cfg.steps [1], true)">next</h:outputLink> 
      </h:panelGrid> 
     </p:panel> 
    </p:tab> 
    <p:tab id="step2" title="Step 2"> 
     <p:panel> 
      <h:panelGrid > 
       <h:panelGrid binding="#{ingresoBean.panelGrid}"> 
      </h:panelGrid> 
      <h:panelGrid > 
       <h:outputLink value="#" onclick="wiz.loadStep (wiz.cfg.steps [0], true);">return</h:outputLink> 
      </h:panelGrid> 
     </p:panel> 
    </p:tab> 
</p:wizard> 

그리고 콩 다음 documenation에서

List<Element> listElement; 
private transient UIComponent panelGrid; 
public IngresoBean() { 
    this.initForm(); 
} 
public UIComponent getPanelGrid() { 
    if (panelGrid == null) { 
     panelGrid = createForm(); 
     } 
     return panelGrid; 
    } 
    ..... 
public void setPanelGrid(UIComponent panelGrid) { 
    this.panelGrid = panelGrid; 
} 

public UIComponent createForm(){ 
    //here the listElement isnull 
    for(SiacFrmdinamico campo:listElement){ 
     .... 
    } 
} 
public void initForm(){ 
    ... 
    // populate listElement 
    ... 
} 

답변

0

:

이 백업 빈을 만들 시작하려면, 그것은 여러 개의 요청 전반 삶 빈 그렇게 요청 SCO를하지 않는 것이 중요합니다 pe 콩. 최적 마법사의 범위는 viewScope입니다.

기본적으로 클래스를 @ViewScoped으로 주석을 달고 마법사가 <f:view> 태그 내에 있는지 확인하십시오.

관련 문제