Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF: Execute values of multiple forms

Tags:

ajax

jsf

jsf-2

I want to submit (execute) values from multiple forms, not just the enclosing form. So, I want to be able to do something like this:

<h:form id="form1>
    <h:inputText id="testinput1" value="#{testBean.input1}" />
</h:form>

<h:form id="form2>
    <h:inputText id="testinput2" value="#{testBean.input2}" />

    <h:commandButton value="Submit">
        <f:ajax execute=":form1 :form2"/>
    </h:commandButton>
</h:form>

How would you solve this?

What is <f:ajax execute="@all"> really supposed to do? It POSTs only the enclosing form seems to be related, but addresses a slightly different problem and also does not solve it (or this).

like image 908
Thorben Croisé Avatar asked Oct 08 '22 11:10

Thorben Croisé


1 Answers

Ajax or not, this is not possible with plain JSF/HTML. All input elements which needs to be processed really needs to go inside the same form.

like image 145
BalusC Avatar answered Oct 13 '22 11:10

BalusC