wood burning stoves 2.0*
The moose likes JSF and the fly likes onclick event from Javascript to trigger backing bean method (Also anybody used J4J ?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "onclick event from Javascript to trigger backing bean method (Also anybody used J4J ?)" Watch "onclick event from Javascript to trigger backing bean method (Also anybody used J4J ?)" New topic
Author

onclick event from Javascript to trigger backing bean method (Also anybody used J4J ?)

harinder singh
Greenhorn

Joined: Jan 14, 2010
Posts: 10

Hi Ranchers,

Problem: I have a text box and a button (Go), I want the same result when user click on Go button or click enter( when focus is in the test box)

Environment: jboss-seam-2.2.0.GA, richfaces-3.3.1.GA, jboss-5.1.0.GA

I have two Question
1) I am having a problem to trigger the backing bean method with onClick event from Javascript , I already search the form and find this link

http://www.coderanch.com/t/211593/JSF/java/Calling-backingBean-method-from-javascript

I also tried the solution to use <h:commandlink> instead of <h:commandButton>..no Luck there (My code works fine but instead of calling the method it just refresh the Page)
The Reason I created the new Link to find out the real reason why the onclick method does not work for backing bean and if there is any other solution (ready to use API)??

Q 2) Anyone used the Default Action for a JSF Form ??
http://www.jsftutorials.net/defaultActionTag.html

I was using it in the Jboss 4.2.3 from one year and it worked like a charm , but when I upgradede my Jboss to 5.0.1 it stop working
what is in the Jboss 5 that can block this ??? no idea (The only thing I can think of jsf-imp/facelet jars etc and I tried to change those with old jars....no luck there)

This is very basic functionality for a web -application and how come there is no information on the net ???

I will really appreciate you comments and solutions.
Thanks




harinder singh
Greenhorn

Joined: Jan 14, 2010
Posts: 10
Anyone ??

Here is my code


This code is wrapped with facelets, I also tried the immediate ="true" condition on command button
Thanks in Advance!!
Harinder


 
jQuery in Action, 2nd edition
 
subject: onclick event from Javascript to trigger backing bean method (Also anybody used J4J ?)