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 select the chekbox generated at runtime of jsf page using javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "select the chekbox generated at runtime of jsf page using javascript" Watch "select the chekbox generated at runtime of jsf page using javascript" New topic
Author

select the chekbox generated at runtime of jsf page using javascript

Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55

Hi,

Can someone please help me selecting the checkbox using javascript? Belew is the view source of the JSF form. On clicking the first checkbox another one should get selected automatically.



I tried to get the value of the checkbox, however, it doesn't work.

Please advise.

Regards
Amit
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16020
    
  20

That's not a JSF form. It doesn't use JSF tags and doesn't bind to a JSF backing bean. It's just plain old HTML.

JavaScript's interactions with checkboxes is done using the "checked" property, I think. Not the "value" property.


Customer surveys are for companies who didn't pay proper attention to begin with.
Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55
Thank you Tim for the response.
Yes. This is not JSF form but the view source of the page created after rendering the JSF page. I have resolved this problem using checked property of the checkbox.

Thanks
Amit

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16020
    
  20

Amit K Jain wrote:Thank you Tim for the response.
Yes. This is not JSF form but the view source of the page created after rendering the JSF page.


Sorry. I missed those 2 key words (view source). Doesn't matter. Same solution either way. Anyway, all fixed.
 
 
subject: select the chekbox generated at runtime of jsf page using javascript