3 Replies Latest reply on May 13, 2011 7:01 AM by Kapil Nimje

    Problem while invoking JSF Action Method

    Kapil Nimje Newbie

      Hi

       

      I have two selectManyListbox components in my jsf xhtml page. First selectManyListbox contains the list of items, so depending upon the values are selected from the first list box, i am populating another list of items in the second selectManyListbox components. Finally i need to passed the selected item values in my action controller method. But when I clicked on the buttoon the action methods doesn't called. If i am not selecting any of the item value from the second list box, in that case the action method is called properly. But i need to pass both the selected values in action method.

       

      Here are my piece of code.

       

      JSF Code:

                      <div id="report_project_fields" style="margin-top:5px;">

                          <h:selectManyListbox id="report_project_id" style="width:300px;" size="5" valueChangeListener="#{reportController.showQuestionnaireList}">

                              <f:selectItems value="#{reportController.availableProjectSelectItems}"/>

                              <f:convertNumber/>

       

                             <a4j:support event="onchange" reRender="report_questionnaire_id" />

                          </h:selectManyListbox>

                      </div>

       

                      <div id="report_questionnaire_fields">

                             <h:selectManyListbox id="report_questionnaire_id" style="width:300px;" size="5">

                                     <f:selectItems value="#{reportController.questionnaireDisplayList}"/>

       

                                      <f:convertNumber/>

                             </h:selectManyListbox>

                      </div>

       

                      <h:commandButton id="preview_button"

                               style="float:right;"

                               value="Run Report"

                               action="#{reportController.previewAction}"/>

       

       

      Action Controller Method:


      @Scope(value = "request")

      @Component(value = "reportController")

       

      public class ReportController {

       

           public String previewAction() {

       

            // Executing some piece of code here

       

           }

      }

       

       

      Kindly suggest what is exactly wrong in my code.