aspose file tools*
The moose likes JSF and the fly likes JSF 2.0 GlassFish 3.0.1 problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF 2.0 GlassFish 3.0.1 problem" Watch "JSF 2.0 GlassFish 3.0.1 problem" New topic
Author

JSF 2.0 GlassFish 3.0.1 problem

Ilya Sorokoumov
Greenhorn

Joined: Jan 11, 2011
Posts: 3

This is code of my xhtml page:




And this is my TestBean class:



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.

I'm using GlassFish 3.0.1.

P.S. I have already posted this at the following forums:
http://community.jboss.org/thread/160831?tstart=30
http://home.java.net/forum/topic/glassfish/glassfish/jsf-20-glassfish-301-problem
http://www.java.net/forum/topic/glassfish/glassfish-webtier/jsf-20-glassfish-301-problem
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Ilya

I think you problem is because you're using nested form, try with this code.


This works for me.

Regards

Cesar

When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
Ilya Sorokoumov
Greenhorn

Joined: Jan 11, 2011
Posts: 3

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.
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Ilya

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.

Regards

Cesar
Ilya Sorokoumov
Greenhorn

Joined: Jan 11, 2011
Posts: 3

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.
Regards,
Ilya.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF 2.0 GlassFish 3.0.1 problem