Is there an ajax event being fired when an item has been added to a richfaces (4.3.1.Final) pickList
? I need to enable disable a button depending on if any items have been selected or not.
The developer guide does not mention this at all, but I found this when googling. Using the suggested solution, I used the following ajax events:
<rich:pickList
var="item"
value="#{someBean.selectedItems}">
<a4j:ajax event="sourceblur" render="somePanelGroupWithTheButton" />
<a4j:ajax event="targetblur" render="somePanelGroupWithTheButton" />
</rich:pickList>
This works. However, the event is fired each time the source or target list is blurred, which is too frequently for my needs.
I also tried <a4j:ajax event="additems" />
and <a4j:ajax event="removeitems" />
. In this case, the event is fired only on removal or adding items, exactly like I want. However, selectedItems
isn't populated with the new item until after the event has been fired. This means I cannot use it to re-render the button, since the list will be empty after adding the first item, and having size one after adding the second element.
Is there an ajax event to listen for that fires after the target list (selectedItems
) has been updated? (and there must be a complete list of supported ajax events for this component somewhere, right?)
I also tried the change event, as suggested here, but it is not fired.