cancel
Showing results for 
Search instead for 
Did you mean: 

JSF and updating page data

ajshaw
Champ in-the-making
Champ in-the-making
Hello. I'm pretty new to JSF, so any help would be greatly appreciated.

I have implemented a system of promoting/demoting documents in the repository, based on an aspect property, 'orderNumber'. This is for the purpose of implementing some simple web-content management functionality.

I have incorporated a promote/demote button for each document alongside the existing action components in browse.jsp. When i click promote, for example, the orderNumber property of the active node is obtained, then all the node's sibblings are inspected, and the one with the closest orderNumber value that is greater than that of the current node is used to swap the values.

This takes place in a new view named 'Ordered' with only the order column being sortable.


This works fine, and by doing this in the web-client, i can change the order that documents are displayed in my website application wich sits ontop of alfresco using the web services.

The problem i'm having is that after clicking the promote or demote button, the processing works fine, but the data displayed in the web-client remains unchanged untill i re-load the page by clicking on the relevant breadcrumb or similar.

If anyone could point me in the right direction i'd be grateful.

Aaron Shaw
6 REPLIES 6

kevinr
Star Contributor
Star Contributor
In your event handler for the button, perform this code:


UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();

Kevin

ajshaw
Champ in-the-making
Champ in-the-making
Thanks Kevin. That worked fine Smiley Happy

manuelgentile
Champ in-the-making
Champ in-the-making
Aaron
can you share this feature?
It looks good!

ajshaw
Champ in-the-making
Champ in-the-making
I'm currently externalizing it after seeing recent posts about how to keep jsf config modification seperate, like the extensions under tomcat/shared/extension…


I'll post here when i'm done.

Thanks.

ajshaw
Champ in-the-making
Champ in-the-making
Okay, i've been looking at the thread about Simon's post regarding putting his new beans and modified faces-config files in a META-INF folder, jarred up in WEB-INF lib. I cant get this to work (not still using the old beans), but even if i could, i am wondering about the way i'd override these beans.

From what i can see, for example, the BrowseBean is referenced in other beans (LoginBean etc…) using the actual class (org.alfresco.web.bean.BrowseBean) rather than any kind of interface or base class. This means that i cannot change the bean implementation without following the trail through all the dependancies and altering the references.

Can anyone tell me if this is really the case? (It's early and i may be missing something).

If this is the case, it's not necessarily a critisism. I just don't want to wast time trying to figure something out that cant be done.

Thanks Smiley Happy

ajshaw
Champ in-the-making
Champ in-the-making
After further thought i suppose that if i extend BrowseBean, say BrowseBeanZ, and copy/paste in the private members/methods it should work okay.

Changing the faces-config-beans.xml to use blah.blah.BrowseBeanZ rather than org.alfresco.web.bean.BrowseBean will mean that i get my BrowseBeanZ functionality, and when referenced in other classes as org.alfresco.web.bean.BrowseBean, it will be cast up from blah.blah.BrowseBeanZ, providing the original functionality that this dependant class needs.

Sorry for the rant. Now i gotta just get the config files mwntioned in my original post to use the new bean!

Thanks.