aspose file tools*
The moose likes JSF and the fly likes value in render is not taking its form on an Ajax refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "value in render is not taking its form on an Ajax refresh" Watch "value in render is not taking its form on an Ajax refresh" New topic
Author

value in render is not taking its form on an Ajax refresh

Lakshmi Karancheti
Greenhorn

Joined: Jul 15, 2013
Posts: 5
Hello!!

I have the below code

<a4j:jsFunction name="selectGroupForManagingCtns"
action="#{ctnGrpMgmtController.loadCTNsForAGroup}"
render="ctnListPanel,ctnTable">
<a4j:param name="name" assignTo="#{ctnGrpMgmtController.groupId}" /> </a4j:jsFunction>
</a4j:jsFunction>


After loadCTNsForAGroup is executed in the backing bean, the required components are not rendered after an ajax refresh. Have to make an F5 to view them.

Please help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

If you're using RichFaces version 3, the attribute you specify on the jsFunction is named "reRender", not "render". Mis-coding it will cause the attribute to be silently ignored.

Also, backing beans are not Controllers. They are Models. Controllers are logic that synchronize the View against the Model and vice versa. JSF action methods and listeners don't do that. They provide business logic and are, strictly speaking, outside of the MVC domain entirely. The actual View synchronization that reflects Model value changes is done by the JSF framework. In the case of AJAX, that includes a little prompting courtesy of the reRender attribute.


Customer surveys are for companies who didn't pay proper attention to begin with.
Lakshmi Karancheti
Greenhorn

Joined: Jul 15, 2013
Posts: 5
what is use is RichFaces4, in which rerender is deprecated
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

Lakshmi Karancheti wrote:what is use is RichFaces4, in which rerender is deprecated


Hence my qualification for RichFaces 3.

The Richfaces 4 docs are horrible and often obscured by the RichFaces 3 docs, but I dug around just to confirm the finer points of this tag. Digressing for a moment to pedantry (again), "reRender" isn't merely "deprecated" in RF4, it's entirely replaced.

In Java terms, "deprecated" means that you'll get warnings, but the deprecated function will still work, providing a smoother migration path and reducing the likelihood that an emergency "1-line fix" won't require a major rewrite on a critical production system in a panic. The lack of true deprecation in RF 4 is what's keeping some major projects of mine mired in RF3, since the last time I saw breakage of this magnitude was when VB6 turned into VB.Net.

Everything in your example looks fine to me. I would confirm (via breakpoint) that the action method is, in fact, being invoked, and I'd use a web traffic tracer (such as FireBug) to see what's coming back from it. It's also possible that if you are incorporating jQuery into your Views that whichever version you are invoking is conflicting with the jQuery version that RichFaces itself yanks in.
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
Also check the id's of the components in the page source. You may need to reference them via formName:componentId depending on your component hierarchies.
Lakshmi Karancheti
Greenhorn

Joined: Jul 15, 2013
Posts: 5
Tim Holloway wrote:
Lakshmi Karancheti wrote:what is use is RichFaces4, in which rerender is deprecated


Hence my qualification for RichFaces 3.

The Richfaces 4 docs are horrible and often obscured by the RichFaces 3 docs, but I dug around just to confirm the finer points of this tag. Digressing for a moment to pedantry (again), "reRender" isn't merely "deprecated" in RF4, it's entirely replaced.

In Java terms, "deprecated" means that you'll get warnings, but the deprecated function will still work, providing a smoother migration path and reducing the likelihood that an emergency "1-line fix" won't require a major rewrite on a critical production system in a panic. The lack of true deprecation in RF 4 is what's keeping some major projects of mine mired in RF3, since the last time I saw breakage of this magnitude was when VB6 turned into VB.Net.

Everything in your example looks fine to me. I would confirm (via breakpoint) that the action method is, in fact, being invoked, and I'd use a web traffic tracer (such as FireBug) to see what's coming back from it. It's also possible that if you are incorporating jQuery into your Views that whichever version you are invoking is conflicting with the jQuery version that RichFaces itself yanks in.










Hi Tim,

Thanks for correcting me.

I have been tracking the action method through logs, and yes it is returning the list, it has to.

Am using JavaScript here.

Thanks,
Lakshmi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: value in render is not taking its form on an Ajax refresh