Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
kirk israel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any thoughts on this?

Is it that silly of a question?
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
kirk israel
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
xfvnxb xb x
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic