1

Consider the following JSF 2.x markup:

<h:form id="form1">

    <h:inputText id="input" value="#{testBacking.input}"/> 

</h:form>


<h:form id="form2">

    <h:commandButton value="go" action="#{testBacking.go()}">
        <f:ajax execute="@all" render="output"/>
    </h:commandButton>               
    <h:outputText id="output" value="#{testBacking.input}"/>

</h:form>

The action method as follows:

public void go() {
        System.out.println("go() is called");
         System.out.println("input: "+ input);
    }

The input value does not submitted to the server upon clicking the button.

Are there any ways to submit the input value to the server (while keeping the input in a different form)?

If you can only submit fields from the same form, then what is the different between the following two?

<f:ajax execute="@all" render="output"/>
<f:ajax execute="@form" render="output"/>
siva636
  • 16,109
  • 23
  • 97
  • 135

1 Answers1

3

A quick search of jsf execute=@all vs execute=@form yields some results:

In essence, the JSF processing works ok but HTML only sends the form that contains the ajax (I suspect HTML specifies a separate request for each form).

Community
  • 1
  • 1
SJuan76
  • 24,532
  • 6
  • 47
  • 87