• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Setting values of f:param using javascript

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

is it possible to set the values of f:param using javascript? below is the sample.

JSF:



Javascript:

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The f:param tags works serverside, while javascripts works client side.

You can use ajax to accomplish that. You can use a library such as ajax4j (part of richfaces) to have ajax support for JSF 1.2 - if you use JSF 2.0 (very new, so not very likely) you'll have ajax support by default.

Using ajax4j, you can (amongst others) bind javascript events to serverside methods:


myPanelId refers to an ajax4j region that should be rerendered.

See documentation on ajax4j website, and the many examples on the web for more information.
 
Dinner will be steamed monkey heads with a side of tiny ads.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic