File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes javascript value to JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "javascript value to JSF" Watch "javascript value to JSF" New topic
Author

javascript value to JSF

Shruthi Sam
Ranch Hand

Joined: Jul 09, 2008
Posts: 73
Hi,
I have a jsf page with a hidden field. In the javascript am setting the value of the hidden component. whenever i submit this, am not getting the value of the hidden field set by javascript. Please let me know how to achieve this. (I want to pass a javascript value to my bean.)
Pardha Reddy
Greenhorn

Joined: Mar 11, 2010
Posts: 10

var varName = document.getElementById(formName+":hiddenField1"); // Here hiddenField1 is id attribute of hidden field.
varName.value="assignmentValue";

This is how variable be assigned to hidden field in javascript. Cross check your syntax once.

Thanks
Pardha
Vaibhav Mittal
Greenhorn

Joined: Jun 11, 2008
Posts: 23
refer to this link. It describes everything you need to know on this topic very clearly.


"Life is good"
Shruthi Sam
Ranch Hand

Joined: Jul 09, 2008
Posts: 73
Hi Vaibhav & Pardha,

Thanks a lot for your replies. It is working now. Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript value to JSF
 
Similar Threads
inputHidden causing conversion problems
Accessing JSF stuff from another servlet
Question on how to fix error on inputHidden field
passing hidden field value to backing bean
How to get the managed bean property value inside the javascript method in facelets?