• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to call JSF action from jQuery ?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear experts,

I have a button in my JSF Page. I want to display a pop up on OnClick event of this. To display a Pop up i have used jQuery.

The javascript is like this...


and the CommandButton is like this...



On Click of "button_1" my javascript got called and Pop up got displayed. The Pop will ask from the user to eneter some value. Now i want to call 'savedetails' method of WelcomeUserBean after popup and the value which user has entered in pop up should be passed to the method.

I tried calling another jsf function (say xyz()) in abc() but the function is not getting called.

i have also used this code. Its workd finr in pure JS but not in jQuery

[code]document.getElementById["UserWelcomeForm:button_1"].click();code]

I have googled a lot and find that we can call using Ajax. but i am not sure how to use it.
Can anyone help me out.

Thanks in Advance !!
 
Manish Suriya
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the solution.. the problem was i was using </h:commandButton> inside <f:verbatim> .
So i did something like this and its working now....


and in JS



Question is: How should i pass the button id (item.buttonid) of button i clicked upon to my savedetails function.

Thanks in Advance !!
 
today's feeble attempt to support the empire
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic