1

I've noticed that this doesn't work for me and I'm wondering if it's just not possible:

<h:form id="one" prependid="false" >
  <h:commandButton>
    <f:ajax execute=":two">
  </h:commandButton>
</h:form>

<h:form id="two" prependid="false">
  ... content ...
</h:form>

Whenever I click the button above ,I can see that the values on form two are not executed as expected. Is this the normal JSF behavior?
To 'trick' it, I usually insert a hidden button in form two and trigger it using JavaScript code when the button in form one is clicked. But that's a 'trick' and makes me work extra when I'm not sure I have to.

I should mention the rendering another form is possible.

Could the prependid attribute be causing problems?

Thanks in Advance!

UPDATE Adding more information that might be relevant - adding the prependid="false" to the forms as it is used in the actual code.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Ben
  • 10,020
  • 21
  • 94
  • 157
  • First you could try `` to check if it is really a problem with ids (@all executes everything on the page). The missing slash in your ajax tag is a typo, isn't it? – Matt Handy Dec 14 '11 at 11:03
  • @MattHandy See BalusC's answer. – Ben Dec 14 '11 at 12:25

1 Answers1

3

No, that's not possible with <f:ajax>. It just submits the parent form. The execute merely tells JSF which components it has to process based on the submitted data, not which request parameters the client side have to send. The button has really to go in the form where it belongs.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555