0 Replies Latest reply on Aug 2, 2011 6:38 PM by ginni machamer

    Search inputs come into bean as null?!?

    ginni machamer Newbie

      I have a search page with a h:form element and a few text inputs. Within the form is an a4j:commandButton that triggers the backing bean search method. The backing bean has a string attribute for each of the input fields. Very simple setup.

      However, when I enter a value into one of the fields and then click Search, in the debugger I can see that the string associated with that input text is null.  I cannot capture the value.  As soon as I step into the search method, requestNumber is null (for instance).

      What might I be missing? This is so simple, it must be something stupid. There are no typos anywhere I can see.

      my bean info
              private String requestNumber;
              public void search(){
                      if (requestNumber != null & !"".equals(requestNumber)){
                              visitors.add(searchVisitorFactory.visitorFor(new RequestNumberValueObject(requestNumber)));
                              feedback.add(" Request Number=" + requestNumber);
              public void setRequesterName(PersonName name) {
                      requester = name;
              public String getRequestNumber() {
                      return requestNumber;
              public void setRequestNumber(String requestNumber) {
                      this.requestNumber = requestNumber;
      in my page (snippet)
                      <!-- FORM -->
                      <h:form id="searchForm">
                          <h:outputLabel value="Request Number:"/>
                          <h:inputText value="#{searchManager.requestNumber}" />
      <a4j:commandButton id="searchButton" value="Search"
                                      action="#{searchManager.search}" reRender="feedback,searchCriteria,reportsCriteria,searchResultsTablePanel" />

      Thanks in advance!