wood burning stoves 2.0*
The moose likes JSF and the fly likes Can't get Ajax to work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Can Watch "Can New topic
Author

Can't get Ajax to work

Christopher Sharp
Ranch Hand

Joined: Dec 12, 2007
Posts: 152
Hello,

There must be an easy solution to this problem, but I'm unable to get Ajax to work.

In my XHTML file I have something like:

Then in my bean I have this:

What is supposed to happen is when I check the checkbox, the contents of the <h:panelGrid> tagged with the id="objectirradiated" are supposed to be rendered, and when I uncheck the checkbox , they are not rendered. Instead nothing happens, but the page is displayed correctly if I refresh the browser. The whole idea of using Ajax is to refresh part of a page without having to reload it, so something is obviously wrong.

I put in a printout to the server in the action method at the end of the Java code, and indeed the status of the booloean is updated when status of the checkbox is changed.

This must be a simple problem to solve, but obviously something is going wrong, so some help would be very much appreciated.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

The chronology of processing on checkboxes is extremely bizarre, even when not using JSF. Try keying on the "change" event instead of "click".


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't get Ajax to work
 
Similar Threads
actionlistener for selectBooleanCheckbox doubt?
Avoid Data Validation during Page Rendering
access ui components in custom valuechangelistener
values in one form dissapearing when editing another
Starting with JSF 2.0 - Clearing login page