title: How to take the return value from method in a method
body: <p>Here I am returning my count variable from a function in Javascript as shown:</p>
  
  <pre><code>&lt;script  type="text/javascript"&gt;
              var count = 0;
              function resetGroupsSelector(groupId){
              //alert(groupId);
              console.log("search_report_form:"+groupId)
              //alert("search_report_form:"+groupId)
              var id = "search_report_form:"+groupId;
  
              //alert(count);
              if(document.getElementById(id).checked) 
                  {
                  count=count+1;
                  alert(count);
                  }
              else
                  {
                  count=count-1;
                  alert(count);
                  }
  
              return count;
              }
  &lt;/script&gt;
  </code></pre>
  
  <p>Now, how do I get my count value from my JSF code in order to print it with htm() function?</p>
  
  <pre><code>final class GroupsSelector extends BaseRenderablePanel&lt;GroupsSelector&gt; {
          private GroupsSelector group(LabourInputReportCriteria.Level level) {
              HtmlSelectBooleanCheckbox box = new HtmlSelectBooleanCheckbox();
              boolean isSelected = selections.isGroupSelected(level);
              box.setSelected(isSelected);
              // box.setDisabled(isDaySelectedOnFirst(level));
              String id="groupBy" + level.getClass().getSimpleName();
              box.setId(id);
  
              box.setOnclick("resetGroupsSelector('"+id+"')");
              box.addValueChangeListener(u.addExpressionValueChangeListener("#{reportSearchCriteriaModel.groupBy}"));
              HtmlOutputText labelComponent = new HtmlOutputText();
  
              labelComponent.setValue(getGroupSelectionValue(level));
              tr().td();
              html(box);
  
              //html("&amp;nbsp;");
  
              html(labelComponent);
              //html("&lt;script&gt; function resetGroupsSelector() {  var x = document.getElementById('search_report_form:groupByWeekLevel'); alert(x); } &lt;/script&gt;");
  
              endTd().endTr();
              return this;
          }
  </code></pre>
  
  <p>Please help me.</p>
  
  <p>Thanks,
  Shruthi S</p>