0 Replies Latest reply on Sep 13, 2007 3:00 PM by unmarshall

    Problem while changing the height of suggestionBox component

      Hi All,

      I am using richfaces suggestionbox. Since the number of items retrieved will depend on the first character typed, i wanted to change the height of the suggestion box (which has a initial value of 150) according to the no of items retrieved.

      I have the following code in the JSF page:

       <rich:suggestionbox id="taSuggestBox" for="taSuggest" style ="font-size:12px" tokens="" frequency="0" selfRendered="true" ignoreDupResponses="true"
       rules="#{uiQuickSearchListPopulator.rules}"
       suggestionAction="#{uiQuickSearchListPopulator.autocompleteTA}" var="result"
       fetchValue="#{result.taName}" rows="#{uiQuickSearchListPopulator.intRows}"
       first="#{uiQuickSearchListPopulator.intFirst}"
       minChars="#{uiQuickSearchListPopulator.minchars}"
       shadowOpacity="#{uiQuickSearchListPopulator.shadowOpacity}"
       border="#{uiQuickSearchListPopulator.border}" width="#{uiQuickSearchListPopulator.width}"
       height="#{uiQuickSearchListPopulator.height}"
       shadowDepth="#{uiQuickSearchListPopulator.shadowDepth}"
       cellpadding="#{uiQuickSearchListPopulator.cellpadding}" >
       <h:column>
       <h:outputText value="#{result.taName}" />
       </h:column>
       <a4j:support event="onselect" action="#{uiQuickSearchListPopulator.getLMFMADCountTA}"
       reRender="tooltipTA,taLMFCount,taMADCount,quickSearchName,quickTotLMFCount,quickTotMADCount"></a4j:support>
       </rich:suggestionbox>
      


      THe default value of the height has been set to 150 px
      In the backing bean's method autocompleteTA i change the height:

       //Set the height of the component to match the no of records fetched.
       int taListSize = taList.size();
       if (taListSize < 8) {
       this.height = new Integer(20*taListSize).toString();
       }
      


      The problem is that the height does not change even though there is one item retrieved.

      Any ideas of what is going wrong?

      Thanks,
      Madhav