aspose file tools*
The moose likes JSF and the fly likes richfaces: javascript function to read the current value of a bean property?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "richfaces: javascript function to read the current value of a bean property??" Watch "richfaces: javascript function to read the current value of a bean property??" New topic
Author

richfaces: javascript function to read the current value of a bean property??

kirk israel
Greenhorn

Joined: May 28, 2009
Posts: 27
(this might be a sneaky way of asking a different question about datascrollers...)

Say I have a binding like
#{dataModel.curPage}

Is there some kind of ajax call I could make from javascript to get the current value of that element?

Something where I could go like

var currentPage = SomeFunction("dataModel.curPage"};
alert("current page is "+currentPage);

but the SomeFunction would of course have to have some kind of communication with the server?

Is this a very typical "binding" activity, or does binding refer only to tying in the controls to the values statically, so to speak?
kirk israel
Greenhorn

Joined: May 28, 2009
Posts: 27
Any thoughts on this?

Is it that silly of a question?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

You'd need to formulate it as an AJAX query. JavaScript runs on the client (browser). The backing beans live in the server. So the client will have to query the server to get the bean value.


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

Joined: May 28, 2009
Posts: 27
Tim, yes, I understand that it would have to be an AJAX query...
my question is, is there some kind of javascript/AJAX library API call already there that I could use for this?
John teras
Greenhorn

Joined: Jun 26, 2009
Posts: 6
xfvnxb xb x
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: richfaces: javascript function to read the current value of a bean property??