[richfaces-issues] [JBoss JIRA] (RF-11617) rich:pickList 4.1.0.M3 - valueChangeListener not firing correctly

Brian Leathem (Updated) (JIRA) jira-events at lists.jboss.org
Thu Nov 3 01:14:45 EDT 2011


     [ https://issues.jboss.org/browse/RF-11617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-11617:
-------------------------------

               Description: 
I have two List<String>, selectedList & wholeList. Using the add/remove(all) buttons
the value change listener is not executed on the server unless you re-click a row in
one of the lists, or the browser window is minimised (or resized etc..), tested on IE8
& Chrome. This has been tested with the converter= attribute and a child f:converter
tag. The child a4j:ajax tag is required.

{code}
<rich:pickList value="#{myBean.selectedList}"
               converter="convertHashMap"
               valueChangeListener="#{myBean.testVCL}">
       <a4j:ajax/>
       <f:selectItems value="#{myBean.wholeList}"
                      var="var" itemLabel="#{var}" itemValue="#{var}"/>
</rich:pickList>
{code}

{code}
public void testVCL(ValueChangeEvent event) {
   Log.log("testVCL");
}
{code}

p.s. Apologies for all the edits to this issue.

  was:
I have two List<String>, selectedList & wholeList. Using the add/remove(all) buttons
the value change listener is not executed on the server unless you re-click a row in
one of the lists, or the browser window is minimised (or resized etc..), tested on IE8
& Chrome. This has been tested with the converter= attribute and a child f:converter
tag. The child a4j:ajax tag is required.

<rich:pickList value="#{myBean.selectedList}"
               converter="convertHashMap"
               valueChangeListener="#{myBean.testVCL}">
       <a4j:ajax/>
       <f:selectItems value="#{myBean.wholeList}"
                      var="var" itemLabel="#{var}" itemValue="#{var}"/>
</rich:pickList>

public void testVCL(ValueChangeEvent event) {
   Log.log("testVCL");
}

p.s. Apologies for all the edits to this issue.

    Workaround Description: 
This is the only way I could find that causes the testAction() method to be
called AFTER selectedList has been modified. I can well imagine that there's
an easier way that I've missed, but I tried a lot of different things...

{code}
<rich:pickList id="picklist"
               value="#{myBean.selectedList}"
               converter="convertHashMap">
       <a4j:ajax event="additems" oncomplete="picklistChanged()"/>
       <a4j:ajax event="removeitems" oncomplete="picklistChanged()"/>
       <f:selectItems value="#{myBean.wholeList}"
                      var="var" itemLabel="#{var}" itemValue="#{var}"/>
</rich:pickList>

<a4j:jsFunction name="picklistChanged" actionListener="#{myBean.testAction}"
                execute="picklist"/>
{code}

  was:
This is the only way I could find that causes the testAction() method to be
called AFTER selectedList has been modified. I can well imagine that there's
an easier way that I've missed, but I tried a lot of different things...

<rich:pickList id="picklist"
               value="#{myBean.selectedList}"
               converter="convertHashMap">
       <a4j:ajax event="additems" oncomplete="picklistChanged()"/>
       <a4j:ajax event="removeitems" oncomplete="picklistChanged()"/>
       <f:selectItems value="#{myBean.wholeList}"
                      var="var" itemLabel="#{var}" itemValue="#{var}"/>
</rich:pickList>

<a4j:jsFunction name="picklistChanged" actionListener="#{myBean.testAction}"
                execute="picklist"/>


    
> rich:pickList 4.1.0.M3 - valueChangeListener not firing correctly
> -----------------------------------------------------------------
>
>                 Key: RF-11617
>                 URL: https://issues.jboss.org/browse/RF-11617
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-selects
>    Affects Versions: 4.1.0.Milestone3
>         Environment: Mojarra 2.1.3, glassfish 3.1.1,  Windows 7, IE8 & Chrome browsers
>            Reporter: Brendan Healey
>            Assignee: Brian Leathem
>
> I have two List<String>, selectedList & wholeList. Using the add/remove(all) buttons
> the value change listener is not executed on the server unless you re-click a row in
> one of the lists, or the browser window is minimised (or resized etc..), tested on IE8
> & Chrome. This has been tested with the converter= attribute and a child f:converter
> tag. The child a4j:ajax tag is required.
> {code}
> <rich:pickList value="#{myBean.selectedList}"
>                converter="convertHashMap"
>                valueChangeListener="#{myBean.testVCL}">
>        <a4j:ajax/>
>        <f:selectItems value="#{myBean.wholeList}"
>                       var="var" itemLabel="#{var}" itemValue="#{var}"/>
> </rich:pickList>
> {code}
> {code}
> public void testVCL(ValueChangeEvent event) {
>    Log.log("testVCL");
> }
> {code}
> p.s. Apologies for all the edits to this issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list