2 Replies Latest reply on Aug 24, 2009 9:38 PM by christofvanhove

    s:selectItems value attribute not updated

    kahlua

      Hi,


      I would like to understand why my use case doesn't work ; what I'm doing wrong and what is the best solution.
      My use case is the following :



      • In my xhtml page I have h:selectManyCheckbox with a s:selectItems child to provide datas.

      • On a AJAX request (on the same page), I'm updating the list used by the previous s:selectItems.

      • When the h:selectManyCheckbox is reRendered the list is the same : I don't see the new element I just added



      Perhaps I'm wrong but when I checked the code, I saw that



      • s:selectItems keep a reference to the originalValue list before converting this list into JSF selectedItems (this action is done during processValidationPhase).

      • During InvokeApplication, my new element is added.

      • During renderResponsePhase, the following code of UISelectItems.java (same code that init the selectedItems) block firing the conversion because the two list compared (originalValue and super.getValue are the same : points to the same object)




      if (selectItems == null || originalValue == null || !originalValue.equals(super.getValue()))




      My first question is : am I right about the use case, how the tag works etc etc ? if not what piece of information am I missing ?
      My second question : how can I resolve this ? (produce a new list for the attribute value ?)


      Thanks in advance
      Francois