1

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.

4

1 に答える 1

0

上記で ui:repeat をネストしたことを言い忘れましたが、それに関して mojarra にバグがあることがわかりました。私が知る限り、修正はコミットされたばかりですが、まだ jar としては公開されていませんが、myfaces を試してみたところ問題なく動作したので、今のところそうします。バグの詳細は次のとおりです。

http://java.net/jira/browse/JAVASERVERFACES-1817

于 2012-12-08T05:00:44.640 に答える