jsf中的多个bean一个按钮

时间:2016-10-17 14:47:57

标签: javascript jsf javabeans

我有两个托管bean,表单及其会话作用域。

form1按钮

<p:commandButton action="#{bean1.method1()}" ></p:commandButton>

form2按钮

<p:commandButton action="#{bean2.method2()}" ></p:commandButton>

我只得到其中一个表格。 “form2 value”为null。为什么呢?

 <script>          
              function submitOthers() {

                   document.getElementById("form1").submit();
                   document.getElementById("form2").submit();

                 }
    </script>

    <h:form id="form3">
        <input type="submit" value="Submit" name="Submit" onclick="submitOthers()"/>           
    </h:form>  

0 个答案:

没有答案