This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSF and the fly likes javascript error with jsf button Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "javascript error with jsf button" Watch "javascript error with jsf button" New topic
Author

javascript error with jsf button

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
i have a jsf page like



The javascript function is as follows:



This code works absolutely fine with normal html buttons.
with JSF, it says document.frmHolidayType.rdoHoliday is null or not an object. How do i resolve this?


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
try getElementById inside your javascript

var obj = window.document.getElementById("selBuiltBy");


Thanks,
JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
It doesnt seem to work!

It says "object Expected" ;
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
ok try this

var obj = window.document.getElementById("form1:rdoHoliday");

see the clientID of the component in backing bean and pass it in the
getElementById() of javascript

System.out.println("client id " + getRdoHoliday().getClientId(getFacesContext()));

Thanks,
JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
The following solution worked to resolve the error:
Thnx for all the help!

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: javascript error with jsf button
 
Similar Threads
Problem using valueChangeListener and onchange
listbox help needed
How to make one of the Radio button default selected
Display value of 'checked' radio button
Issue with Ajax implementation on <h:selectoneradio> control