1 Reply Latest reply on Oct 11, 2007 3:24 AM by nagypalg

    selectOneMenu and ajax problem with 3.1.1

      Hi all,

      I have a weird problem with h:selectOneMenu and a4j:support. I have the following code:

      <a:region>
       <h:selectOneMenu id="#{filterName}" value="#{lister[filterName]}"
       styleClass="filterInput" >
       <s:selectItems value="#{lister[filterValues]}" var="filterValue"
       label="#{(not empty filterValue) ? filterValue : '*'}" />
       <a:support event="onchange" reRender="#{tableName}"
       status="globalAjaxStatus" />
       </h:selectOneMenu>
       </a:region>


      The bean lister, and the string filterName are set in previous code. Let's say filterName has the value "bar".

      The filter values are simple strings, and I add a null for "don't care".
      Now, when I change the list, the String value of the "bar" attribute is updated as expected. The problem is when I leave the page, first the attribute is updated to its expected value, but then it is updated to null many times (!) during the update model values JSF phase. This of course causes problems when returning to the page. Also, if I remove the ajax region around the selectOneMenu, the "bar" attribute is first updated to its expected value then it is updated to null (again many times). I.e., without an Ajax region it is impossible to use the selectOneMenu component because the value is changed back to null again and again.

      I only have the problem with RichFaces 3.1.1, with RichFaces 3.0.1 + Ajax4JSF 1.1.1 everything works as expected with or without the Ajax region.

      I am using Seam2 CR2, but it does not matter whether the backing bean is in the session or conversation scope (conversation scope causes many problems with RichFaces 3.1.X). So the problem is probably not Seam-related.

      Are there any ideas what could be the problem?

        • 1. Re: selectOneMenu and ajax problem with 3.1.1

          So, nobody has any ideas? Or is the problem trivial, and it is just me that I cannot notice the cause? In the latter case I would be thankful for any pointers. Currently this issue stops me from using Richfaces 3.1.X.

          I forgot to mention that there are no validation errors, and all JSF phases are properly executed. So I have absolutely no idea why the bean attribute is set to null. The attribute is not bound to any other page element, and as I said, the same code works with RF 3.0.1.