0

I am facing and issue while rendering my plots.

    <h:form id="form1">
           <a4j:commandButton id="b1"
            value=" HeatMap " action="#{bean.heatMap}"
            oncomplete="plotHeatMap('#{bean.heatMapData}')"
            render="fullPage" />
    </h:form>

<h:form id="form2">
           <a4j:commandButton id="b2"
            value=" BarChart " action="#{bean.barChart}"
            oncomplete="plotBarChart('#{bean.barChartData}')"
            render="fullPage" />
    </h:form>

The user has to select first some input data which gets set to bean and then click on either of these buttons.This will calculate few things and fetch the calculated data from bean and render and the corresponding plot.The plots are created using D3.js

I have 2 issues here: 1. Buttons work on second click but not on first.

2.The data fetched in the previous execution is rendered on the first click and actual data is rendered on the next click.

I have cleared the all the lists in the bean as well as the JavaScript function.

I am not able to figure out the reason for such behavior. Please advice.

user2753788
  • 51
  • 1
  • 3
  • Might be related to [this mojarra bug](http://stackoverflow.com/questions/11408130/jsf-commandbutton-works-on-second-click). What version of JSF are you running? – kolossus Sep 16 '14 at 06:38
  • I m using JSF version 2.1. with Richfaces version 4.2. I had look at the suggested post but the given javascript did not work for me. – user2753788 Sep 17 '14 at 17:08

0 Answers0