f:ajax not working on tomcat7/eclipse

Posted by mntgoat on Stack Overflow See other posts from Stack Overflow or by mntgoat
Published on 2012-12-07T01:11:51Z Indexed on 2012/12/08 5:04 UTC
Read the original article Hit count: 167

Filed under:
|
|
|
|

I have this very simple code which works fine until I add a f:ajax tag.

Code that works:

<h:commandButton disabled="#{!feature.available}" class="featureButton"
        value="#{feature.selected ? 'selected': feature.available? 'available':'unavailable'} "
        style="vertical-align: top;" action="#{Bean.toggleFeature(feature)}">
    </h:commandButton>

Code that doesn't work:

<h:commandButton disabled="#{!feature.available}" class="featureButton"
        value="#{feature.selected ? 'selected': feature.available? 'available':'unavailable'} "
        style="vertical-align: top;" action="#{Bean.toggleFeature(feature)}">
        <f:ajax event="click"  />
</h:commandButton>

As far as I can tell the jsf.js file is loaded fine, this is automatically added by the facelet servlet to the head of my rendered document <script type="text/javascript" src="/www/javax.faces.resource/jsf.js.xhtml?ln=javax.faces"></script> and I was even able to do a jsf.ajax.request directly from javascript and got the page to rerender something.

I am using mojarra 2.1.13, tomcat 7, eclipse juno, java 7.

Any thoughts on what I might be doing wrong or how I might be able to troubleshoot this issue? debugging it in javascript didn't help at all.

Thanks.

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about jsf