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

Brendan Healey (Commented) (JIRA) jira-events at lists.jboss.org
Thu Nov 3 06:46:45 EDT 2011


    [ https://issues.jboss.org/browse/RF-11617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639619#comment-12639619 ] 

Brendan Healey commented on RF-11617:
-------------------------------------

Hi, I don't know if you saw my workaround description but I did find the events you
mention. From my perspective there are two issues:

1. If I add a child tag to the picklist like this:

   <a4j:ajax event="additems" listener="..." oncomplete="alert('additems')"/>

   then the js alert will be shown but the listener will not be called
   when item(s) are moved from the LHS to the RHS (the listener is declared
   public void f(AjaxBehaviorEvent event)). This is why I'm having to use a
   jsFunction workaround.

2. Determining the correct point at which to call any supplied value change
   listener(s).

   I noticed that when I click the add control the setter is called for the
   pickList value= attribute, so the value has changed. The JSF spec (3.2.7.3)
   says:

   "If the validation for the component did pass successfully, and the previous
    value of this component differs from the current value, the ValueChangeEvent
    is published."

I appreciate that it isn't a straightforward scenario with a complex component
such as picklist, but executing when the component loses focus isn't intuitive to
me.

My use case is that I have a save changes button that persists the changes made by the
picklist. It is disabled initially, if the user moves add or removes any entries from the
target selection the save changes button is highlighted in red and enabled. This is what
I was attempting to use the VCL for.

I just thought I would make you aware of this behavior, I'm perfectly happy with the
workaround so if you want to close this it's no problem for me at all.
                
> 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
>              Labels: waiting_on_user
>
> 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