3 Replies Latest reply on Sep 16, 2010 7:31 AM by Angelo Immediata

    RichFaces picklist : optgroup

    Angelo Immediata Newbie

      Hi

      I'm using RichFaces 3.3.3. In my xhtml page i'm using a picklist component. Now in my elements list (where the user can do the choice) i have several objects. This objects are grouped by category. Now what i'ld love to show to the user is a list with all the objects grouped by category and with a "label". To be clearer i'ld love to show to the user something like this little HTML sample:

      <html>
      <body>
      <select id="multiplo" multiple>
        <optgroup label="Swedish Cars">
          <option value="volvo">Volvo</option>
          <option value="saab">Saab</option>
        </optgroup>
        <optgroup label="German Cars">
          <option value="mercedes">Mercedes</option>
          <option value="audi">Audi</option>
        </optgroup>
      </select>
      <br/>
      <select id="singolo">
        <optgroup label="Swedish Cars">
          <option value="volvo">Volvo</option>
          <option value="saab">Saab</option>
        </optgroup>
        <optgroup label="German Cars">
          <option value="mercedes">Mercedes</option>
          <option value="audi">Audi</option>
        </optgroup>
      </select>
      </body>
      </html>

       

      <html>

      <body>

      <select id="multiplo" multiple>

        <optgroup label="Swedish Cars">

          <option value="volvo">Volvo</option>

          <option value="saab">Saab</option>

        </optgroup>

        <optgroup label="German Cars">

          <option value="mercedes">Mercedes</option>

          <option value="audi">Audi</option>

        </optgroup>

      </select>

      </body>

      </html>

       

      Is this possible in the pickList component?

       

      Any help would be really appreciated

      Regards,

      Angelo