incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Vangasse" <>
Subject RE: selectManyListbox issue
Date Mon, 05 Mar 2007 15:56:13 GMT
I've looked a little further into this and it looks like it might be a
bug in Trinidad. In SimpleSelectManyRenderer getSelectedIndices() method
an int array called indices is used to define the index of each value in
the selection list. The code works fine when the selection list and the
value list are in the same order, but when they are different it breaks

The indices array is passed to SimpleSelectManyListboxRenderer
encodeElementContent() method where assignment of the boolean selected
variable relies on the values in the array being in numerical order:

    int selectedCount = selectedIndices.length;
    int selectedEntry = 0;
    for (int i = 0; i < count; i++)
      boolean selected = ((selectedEntry < selectedCount) && 
                          (i == selectedIndices[selectedEntry]));
      if (selected)

      SelectItem item = selectItems.get(i);
           context, arc, component, item, converter,
           valuePassThru, i, selected);

When the selection list and the value list have different ordering the
values in the indices array are not in numerical order. The code then
misses selected elements and they are not rendered as selected. Is this
a bug?


Steve Vangasse

-----Original Message-----
From: Steve Vangasse [] 
Sent: 16 February 2007 17:19
Subject: tr:selectManyListbox issue

Is anyone else having issues with tr:selectManyListbox on the current
trinidad snapshot. It only renders one option as selected on a list
where there a multiple selections. Submitting the form with multiple
selections updates the model correctly but then renders just the one as
    <tr:selectManyListbox label="#{msgs.deliveryZones}"
salesOrders$delivery$optionForm.crudObject.zones is a List of objects
and salesOrders$delivery$deliveryUtils.zones is a List of SelectItems
whose vales are the complete set of those objects.
Any ideas?
Steve Vangasse

View raw message