0 Replies Latest reply on Mar 20, 2007 6:00 PM by Russell Loewen

    tableSuggestAjax not looking for correct method signature?

    Russell Loewen Newbie

      I have set up tableSuggestAjax as per every example I have seen anywhere. (code below)
      One problem I am having is that even though all examples say the "suggestedItemsMethod" is expecting a String parameter, if I have any parameters in the actual method signature I get an EL exception. I had the same problem with inputSuggestAjax.


      <s:tableSuggestAjax var="refData" id="incomeExpenseSuggest" startRequest="2"
       nextPageFieldClass="ajaxNextTablePageField"
       value="#{applicantOperationDetailsBackingBean.foo}" betweenKeyUp="300"
       columnOutClass="tableSuggestOut" columnHoverClass="tableSuggestHover"
       suggestedItemsMethod="#{applicantOperationDetailsBackingBean.suggestIncomeExpenseDescriptions}"
       tableStyleClass="ajaxTable" charset="utf-8">
       <t:column>
       <f:facet name="header">
       <s:outputText value="Income Type"/>
       </f:facet>
       <s:outputText for="incomeExpenseSuggest" label="#{refData.englishName}"/>
       </t:column>
       <t:column>
       <f:facet name="header">
       <s:outputText value="Code"/>
       </f:facet>
       <s:outputText for="code" label="#{refData.typeCode}"/>
       </t:column>
      
       </s:tableSuggestAjax>
      


      public List getSuggestIncomeExpenseDescriptions(String value) {
       List<ReferenceData > result = new ArrayList<ReferenceData>();
      
       if (this.incomeAndExpenseRefData == null) {
       // initialize once
       this.incomeAndExpenseRefData = getRefDataService()
       .getReferenceDataList(RefDataTypes.INCOME_EXPENSE_TYPE);
       }
      
       for (Iterator iter = incomeAndExpenseRefData.iterator(); iter.hasNext();) {
       ReferenceData rd = (ReferenceData) iter.next();
      
       if ((value != null) &&
       rd.getEnglishName().toLowerCase().contains(value.toLowerCase())) {
       String data = rd.getEnglishName()+" ("+rd.getTypeCode()+")";
       result.add(data);
      
       }
       }
      
       return result;
       }