1

I've already read "all" other issues concerning not working CommandLinks, but none apply for me, hopefully there's another solution.

I have an a4j:htmlCommandLink which only works the first time it is clicked. If I click somewhere else on the page which triggers a reRender of the a4j:outputPanel, then it WILL work every time I click.

<a4j:outputPanel rendered="true" id="results">
<a4j:form id="csv-form">
<a4j:htmlCommandLink title="Export" action="#{bean.export()}" value="Export CSV" id="csv-link"/>
</a4j:form>
<a4j:form id="other-form">
<a4j:commandLink value="Test" action="#{bean.action()}" reRender="results" title="Test">
</a4j:form>
</a4j:outputPanel>

Why doesn't it work the second time I click (before I do a reRender)?

UPDATE This works:

<a4j:form id="csv-form">
<a4j:htmlCommandLink title="Export" action="#{bean.export()}" value="Export CSV" id="csv-link"/>
<a4j:support event="onclick" reRender="results"></a4j:support>
</a4j:form>
E.R. Daams
  • 11
  • 5

1 Answers1

0

I don't know if this is a bug in JSF 1.2, but it seems that the a4j:outputPanel is not rendered after I click the htmlCommandLink the first time.

I added an a4j:support. On the onclick event it reRenders results. I've updated the code above.

Every time the htmlCommandLink is clicked, the "results" outputPanel is reRendered. And it works. :)

E.R. Daams
  • 11
  • 5