Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a backing bean function when inputtext value changes

 
Dishpal Bhaluja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dishpal Bhaluja
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic