1 Reply Latest reply on Jun 30, 2008 5:23 AM by daniel.soneira

    suggestionBox: does not work in nested a4j:repeat

    daniel.soneira

      I noticed the following bug, when using a suggestionBox that is nested inside a subtable (a4j:repeat).

      As you can see in the code below, there are TWO a4j:repeats.
      Every suggestion box works, except when there is MORE than 1 element inside the nested repeat.

      Environment:
      RF-3.1.6.GA
      MyFaces 1.1.15
      Facelets 1.14

      Can you please verify my findings / file a JIRA issue [version 3.1.x]?

      Pseudo-Example (sub suggest 2.2, 2.3 don't work):

      row 1 - suggest 1 - sub suggest 1.1
      row 2 - suggest 2 - sub suggest 2.1
       - sub suggest 2.2
       - sub suggest 2.3
      row 3 - suggest 3
      


      Model
       Object 1 - Alias 1
       Object 2 - Alias 2.1, Alias 2.2, Alias 2.3
       Object 3 - No aliases
      


      View:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:tags="http://www.example.com/tags">
      <head>
       <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
       <meta http-equiv="cache-control" content="no-cache" />
       <meta http-equiv="pragma" content="no-cache" />
       <title>rich:suggestionbox test</title>
      </head>
      <body>
      <f:view>
       <f:loadBundle var="msg" basename="messages"/>
       <p><b>Suggestion for Alias 2.2 does not work</b></p>
       <p>Autocomplete function is called - but no suggestion list is displayed</p>
       <p>try "a" or "b" in Input fields</p>
       <a4j:form id="testForm">
       <table>
       <tr>
       <th>Column 1</th>
       <th>Column 2</th>
       <th>Column 3 (Subtable)</th>
       </tr>
       <a4j:repeat value="${exampleModel.objectList}" var="var" rowKeyVar="row">
       <tr>
       <td>
       Row ${row + 1}
       </td>
       <td>
       <h:inputText id="text" />
      
       <rich:suggestionbox for="text" suggestionAction="${exampleController.autocomplete}" var="suggest" selfRendered="true">
       <h:column>
       <h:outputText value="${suggest}"/>
       </h:column>
       </rich:suggestionbox>
       </td>
       <td>
       <table>
       <a4j:repeat value="${var.alias}" var="alias" rowKeyVar="sub">
       <tr>
       <td>
       Alias ${row+1}.${sub+1}
       <h:inputText id="textAlias" />
      
       <rich:suggestionbox for="textAlias" suggestionAction="${exampleController.autocomplete}" var="suggest" selfRendered="true">
       <h:column>
       <h:outputText value="${suggest}"/>
       </h:column>
       </rich:suggestionbox>
       </td>
       </tr>
       </a4j:repeat>
       </table>
       </td>
       </tr>
       </a4j:repeat>
       </table>
       </a4j:form>
      </f:view>
      </body>
      </html>
      


      I can upload a war-file if you need one.