1

在我的页面上,在将验证码添加到代码之前,Galleria 工作正常。

将验证码添加到代码画廊后,页面上未显示。

我试图将两种验证码保持在不同的形式,但仍然无法正常工作。

验证码工作正常。

我不知道这有什么问题。

<h:form id="frmTest">
  <center >
    <br/><br/>
    <table width="70%" border="0">      
        <tr>
           <td width="70%" align="center">
                 <p:panel >
                       <p:galleria value="#{LoginBean.imgList}" 
                                   var="image" effect="slide" 
                                   effectSpeed="1000"
                                   panelWidth="500" panelHeight="300" 
                                   frameWidth="100" frameHeight="70" 
                                   rendered="true">
                              <p:graphicImage value="../resources/images/{image}"/>
                         </p:galleria>
                 </p:panel>
            </td>
            <td width="30%">
                  <p:panel>
                          <p:commandButton id="btnShowCaptcha" 
                                           process="@form"
                                           onclick="captchaDlgWar.show()"
                                           value="Show Captcha"/>
                  </p:panel> 
            </td>
       </tr>
    </table>

  </center>

  <p:dialog widgetVar="captchaDlgWar" id="capchaDlgId"
             hideEffect="explode" showEffect="clip"
             modal="true" closable="true" resizable="false"
             header="Prove you are human..." width="360" height="190">

        <h:panelGrid columns="1">

               <p:captcha label="Captcha"
                               id="captchaId"
                               language="tr"
                               required="true"/>
               <p:commandButton id="btnContinue"
                                ajax="false"
                                value="Continue"
                                action="#{MyBean.onContinueAction}"/>

        </h:panelGrid>
  </p:dialog>
</h:form>

豆豆

public String onContinueAction() {

    RequestContext.getCurrentInstance().execute("captchaDlgWar.hide()");
    return "somePage.xhtml";

}

谢谢。

4

1 回答 1

0

尝试把你的dialog外部和在你的对话框中form添加另一个form

所以你会在里面有一个带有 galeria 的对话框和另一个对话框,dialog确保你没有嵌套forms

<h:form.... <p:galleria...</h:form>

<p:dialog><h:form.... <p:captcha ...</h:form></p:dialog>

我会尝试使用p:panelGrid Primefaces PanelGrid而不是表格

于 2012-06-19T11:03:30.950 回答