aspose file tools*
The moose likes JSF and the fly likes Calling a backing bean function when inputtext value  changes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Calling a backing bean function when inputtext value  changes" Watch "Calling a backing bean function when inputtext value  changes" New topic
Author

Calling a backing bean function when inputtext value changes

Dishpal Bhaluja
Ranch Hand

Joined: Dec 30, 2007
Posts: 96
Platform:RSA 7.0
Using IBM-JSF Implementation ( JSF 1.1)
Uses Extended ibm jsf components

Problem:I need to call a managed bean action() when input box event changes ,I need to output a text based on some business logic.
Tag I am working with:<hx:ajaxRefreshSubmit>

Currently I know a method to call setter method of property i want to change,but my aim is to call an arbitary function in my managed bean,so us to update the output text.Input box has an hx:behaviour attached to it.And output box is inside a panelbox(for ajax updates enabling).
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

You cannot call an arbitrary method in a JSF backing bean from a web client, because the architecture doesn't support it. JSF web pages aren't some sort of magic, they're HTML, transferred via HTTP and subject to the restrictions of HTTP. The server-side framework is designed to respond to the HTTP requests in a certain way and according to a specific request lifecycle desfinition.

However, you can do an awful lot within that framework. While the only logic methods you can invoke are listeners and action processors, you can specify what parts of the client page will be sampled and updated when a server method is invoked. I've done some pretty powerful things with just basic property mutations and action methods.

I don't know anything about how IBM manages this capability, but the RichFaces tag framework makes it quite easy, so I know it can be done. Like I said, I've done it. I could definitely do what you're trying to do.


Customer surveys are for companies who didn't pay proper attention to begin with.
Dishpal Bhaluja
Ranch Hand

Joined: Dec 30, 2007
Posts: 96
Tim the problem is that IBM RSA 7.0 is not supporting RichFaces

So inorder to call ajax functions.

I should use javascript.Which is the best implementation for an ajax call in jsf without this richfaces.
Anyway ,now its cleart that i should implement it using javascript and phase listners.Or is there any other way,something like DWR and all.

Lead me through this
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a backing bean function when inputtext value changes