2012-05-16 22 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