aspose file tools*
The moose likes JSF and the fly likes Ajax render outside of form problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Ajax render outside of form problem " Watch "Ajax render outside of form problem " New topic
Author

Ajax render outside of form problem

Robe Eleckers
Greenhorn

Joined: Jul 08, 2009
Posts: 9
Hello,

I have a problem with Ajax partial rendering. My (simplified) situation is as follows:

Flow (how I want it):
1. <cu:menu> component renders an html link like: <a href="#" onclick="mojarra.ab('j_idt9:j_idt10',event,'click',0,'content',null)">Click</a>
2. Clicking on this link should first call the ajax listener #{myListener.update}. This listeners changes the value of '#{myBean.value}'.
3. Now the component with id 'content' should be re-rendered and show the updated value of '#{myBean.value}'

However, in reality step 2 and 3 are switched, so first the rendering is done, then the listener is called. So only after the second click I see a content change.

Any ideas how to handle this?

Update:
I had a feeling this behavior is because I try to render something outside my ajaxified form. So I added the same outputText tag inside my form and render that at the same time as my outputtext outside the form.

Now I see the following sequence when clicking a link generated by the cu:menu component:
1. Component with id 'content' is rendered (outside the form).
2. #{myListener.update} is called, this changes the value of myBean.value.
3. Component with id 'test' is rendered (inside the form).

This causes the component outside of the form to be re-rendered without the value being changed first. Any ideas on how to change this?

Robe

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ajax render outside of form problem
 
Similar Threads
JSF + AJAX partial rendering redundent method call
Ajax listener method is not fire for other(except first) component
Composite Components with ViewScoped bean
Ajax support in Jsf 2.0
ui:repeat + AJAX