This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
When I input something into h:inputText it shows me the second form.
But when I press the button or the link on the second method of
testBean is not getting call and the page is just rerendered.
If I press the button or the link at the second time it works fine and calls testBean method.
Thanks for your answer.
But I want to have several forms on my page and I want to re-render them. I will try your solution of course but I think that it's normal to have a couple of forms and re-render them. It worked fine in a4j with JSF 1.2.
I'm just trying to figure out it's a bug or feature of JSF 2.0.
Yes you can have several forms in you page, but the second form casue the problem that you have, I'll try to explain because it happens, when you click in the Render commandLink you make a partial request to the server and this response is loaded in the page dynamically and don't generate a markup for the form2 you can ckeck this choosing view source from you browser, when you click in either of the two buttons Test1 or Test2 you make a new request (postback) and it's responses generate the markup for the form2 (check it view seeing the view source of the page) and then, with the button within a form2 you can call the method in the managed bean.
My example works because the buttons always are within the form, I think it's not a bug but a JSF 2.0 feature.
I hope to have answered your question, sorry but my English is not very good.
Thank you again. May be it's not a bug but it still looks for me like a JSF 2.0 limitation.
Because this worked fine in JSF 1.2 with a4j but now it doesn't(with RF 4.0 it doesn't work either). So I guess that you answered my question but it seems I don't like it. It's normal.
Thank you again.