Hi folks,
First of all, I would like to thank the Alfresco community for all the great support and contributions. It is nice to find help when once needs it.
Now, let me cut the chase. My problem looks simple, it should be simple and straightforward, but I am struggling to solve it. I am using the richList UIComponent and the dataPager UICommand, this last one as a child of the richList, just as the Alfresco Explorer source is using it. I am using those components to display all the pooled workflow tasks in the system and paging the result. Until now everything works smoothly. Now, I need to pick up the ActionEvent when the DataPager is clicked with the aim to find out what the next current page will be, since I am improving the paging mechanism by building the model for just the workflow tasks in the current page, rather than for all the resulting workflow tasks, as it does by default. This change will improve very significantly the performance when loading the worflow tasks in the dashboard, and the end users will be happy because they don't have to wait an average of 7 sec to move between pages.
Now, taking a look at the UICommand class (
https://docs.oracle.com/cd/E17802_01/j2ee/j2ee/javaserverfaces/1.1/docs/api/) it says:
"When the
decode()
method of this
UICommand
, or
its corresponding
Renderer
, detects that this control has been
activated, it will queue an
ActionEvent
.
Later on, the
broadcast()
method will ensure that this
event is broadcast to all interested listeners."
Great! I just need to add a new Listener to the DataPager and I will be notified when someone clicks that UIcomponent. Therefore, I take a look at the ActionListener type (
https://docs.oracle.com/cd/E17802_01/j2ee/j2ee/javaserverfaces/1.1/docs/api/) and it says:
"A listener interface for receiving
ActionEvent
s. A class that
is interested in receiving such events implements this interface, and then
registers itself with the source
UIComponent
of interest, by
calling
addActionListener()
. "
I feel very excited at this point since it looks very promising. Therefore, I implement my customActionListener and then I added to the DataPager UIComponent by dataPager.addActionListener(). At this point, I have to tell you that I am getting the DataPager UIComponent in my managed bean by binding it, just like this:
<a:dataPager styleClass="pager" binding="#{WorkflowDashletBean.dataPager}" />
This way the dataPager filed in my WorkflowDashletBean is initialized with the dataPager component.
Anyway, I have not yet been able to get this working. My CustomActionListener does not do anything when I click on the dataPager component, so I think that I am not adding the listener to the right dataPager component. In particular, I would like to know whether or not my approach to pick up that ActionEvent from the DataPager is correct or not, and It would be great if you could share or give me some feedback about getting this working.
May Thanks,
David