Value change listener on Picklist

UI Components for JSF
Post Reply
trungp0107
Posts: 10
Joined: 11 Nov 2010, 06:42

08 Dec 2010, 12:14

Hello all,

I'm using <p:picklist on a specific page for my project. I try to use valueChangeListener attribute, but it does not work.

Here is my code :

Code: Select all

<p:pickList id="selectRole_DualList" widgetVar="selectRole_DualList" value="#{roleController.dualListRoles}"
                                        var="role" iconOnly="true" valueChangeListener="#{roleController.processDualListRolesChange}"
                                        itemLabel="#{role}" itemValue="#{role}" converter="rolesConverter" immediate="true">
                                <f:validator validatorId="dualListRoleValidator" for="selectRole_DualList" />
                                <f:facet name="sourceCaption">#{bundle.AddRoleToGroupCaption_availableRoles}</f:facet>
                                <f:facet name="targetCaption">#{bundle.AddRoleToGroupCaption_selectedRoles}</f:facet>
                            </p:pickList>
Could someone can help me how to add a value change listener for the picklist ?, I mean that when the picklist change or we take a item from source to target list, the listener will be aware.

And one more question, I use FireBug to see the html code rendered from primefaces tag. My picklist will be rendered as below, and I see we have no id :
Here is the code detail :

Code: Select all

               <ul class="ui-widget-content ui-picklist-list ui-picklist-target ui-corner-bl ui-corner-br ui-sortable">
                    <li class="ui-state-default ui-picklist-item ui-corner-all" style="display: list-item;">technician</li>
                    <li class="ui-state-default ui-picklist-item ui-corner-all" style="display: list-item;">supervisor</li>
               </ul>
Could someone can help me on this ?, :)
Thanks,

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 47 guests