2012-05-16 27 views
0

我在primefaces嚮導裏面有一個手風琴內部的命令鏈接,它們都是相同的形式 - 我沒有嵌套形式,但命令鏈接的動作是沒有被解僱。 這裏是我的網頁:commandlink動作不會觸發裏面p:手風琴

<ui:define name="content"> 
     <h:form id="createSubject"> 
     <p:wizard flowListener="#{createWizard.flowListener}" widgetVar="wiz" showNavBar="false"> 
     <p:tab id="personal" title="#{createWizard.tab1Title}"> 
      .... 
     </p:tab> 
     <p:tab id="conclusion" title="#{createWizard.tab2Title}"> 
      <p:panel header="#{createWizard.panel2Title}"> 
      <p:accordionPanel value="#{createWizard.similarSubjects}" var="subject"> 
       <p:tab title="#{subject.VPrenom} #{subject.VNom}"> 
        <h:panelGrid columns="2" cellpadding="5"> 
        <h:outputText value="#{createWizard.firstName}: " /> 
        <h:outputText value="#{subject.VPrenom}" /> 
        <h:commandLink value="#{createWizard.completeSheet}" actionListener="#{createWizard.completeSubjectSheet(subject.VIdPool)}"/> 
        </h:panelGrid> 
       </p:tab> 
      </p:accordionPanel> 
     </p:panel> 
     </p:tab> 
     </p:wizard> 
     <p:commandButton value="#{createWizard.nextButtonTitle}" onclick="wiz.next()" style="float:right;"/> 
     </h:form> 
     </ui:define> 

和我支持bean的方法:

public void completeSubjectSheet(String subId){ 
    mk.sdc.helpers.Link link = mk.sdc.helpers.Link.getLink(); 
    try { 
     FacesContext.getCurrentInstance().getExternalContext().redirect(link.mkLink("/POOL/view.jsp?V_ID_POOL="+subId)); 
    } catch (IOException ex) { 
     Logger.getLogger(CreateWizard.class.getName()).log(Level.SEVERE, null, ex); 
    } 
} 

任何想法?謝謝。

+0

是wiz.next()返回false任何機會呢? – Daniel

+0

問題在於手風琴內部的h:commandlink而非commandbutton。嚮導很好。 – Questionmark

回答

1

因爲actionListener不能接受任何參數,所以必須將action屬性用於commandLink。

編輯

您可以使用該h:linkh:outputLink?就像

<h:link outcome="/POOL/view.jsp?V_ID_POOL=#{subject.id}" />

+0

你有沒有標籤進行調試?所以你可以看到所有的錯誤(如果有的話) –

+0

我需要使用參數將支持bean重定向到jsp頁面我可以使用什麼來使其工作?請參閱我的支持bean方法... – Questionmark

+0

@Questionmark:是現在調用的操作方法還是不?應該在另一個問題中提出另一個問題。 – BalusC