cancel
Showing results for 
Search instead for 
Did you mean: 

'Details of' page not refreshed after action click

hbf
Champ on-the-rise
Champ on-the-rise
I have implemented a client action for the action group "doc_details_actions". The action (see JavaScript code below) adds an aspect to the current node. The problem is that afterwards

* the evaluator is not called again
* the property sheet is not rebuild

How can this be fixed?

(This seems to be related to the post Refresh page after actionlink click but I need a JavaScript solution, if possible…)

Many thanks,
Kaspar


// extract parameter values
var nodeRef = args["nodeRef"];
var node = search.findNode(nodeRef);

// add aspect
node.addAspect("kc:copyrightable");

// return to previous page
// (See http://forums.alfresco.com/viewtopic.php?t=4654 and
// http://wiki.alfresco.com/wiki/Externalised_Client_Actions.)
var goBack = "<script>history.back();</script>";
goBack;
6 REPLIES 6

xerox
Champ in-the-making
Champ in-the-making
history.back() just go back to previous page.
you can try to locate your previous page.

Because you've got the node,you can go to there, or to the parent(node.parent)
e.g.

var loc="http://" + location.hostname + "/alfresco/navigate/browse/workspace/SpacesStore/" + node.id

var goBack = "<script>location.href = '" + loc + "'script>";
goBack; 

If you want to go the details of a space or document you have to change "browse" with "showSpaceDetails" or "showDocDetails".

I think this should work.

Friendly regards,

Nick

hbf
Champ on-the-rise
Champ on-the-rise
Works perfectly. Thanks a lot for the hint, here's the code I use


// …

// return to previous page
// (See http://forums.alfresco.com/viewtopic.php?t=4654 and
// http://wiki.alfresco.com/wiki/Externalised_Client_Actions.)
var goBack = "<script>location.href = 'http://' + location.hostname + ':8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/" + node.id + "';</script>";
goBack;

Many thanks!

P.S. I added a link to this post to the Externalised Client Actions wiki page.

hbf
Champ on-the-rise
Champ on-the-rise
Hm, sadly, this only solves the first issue mentioned in the original post. The property sheet is still not rebuilt (and still shows, when I remove an aspect using the clicked action, the aspect's fields).

Any ideas how to tackle this?

I know of a related Java workaround but I think this is a bug: the property sheet should realize itself when it needs to update itself.

xerox
Champ in-the-making
Champ in-the-making
I'm not familiar with this problem…


You do the node.save action? Because else the properties modification aren't saved..

hbf
Champ on-the-rise
Champ on-the-rise
You do the node.save action? Because else the properties modification aren't saved..

If think you don't have to (node.save() is needed if you change properties). But even if I do, the behaviour is still the same.

But thanks a lot for taking the time to help!

Kaspar

xerox
Champ in-the-making
Champ in-the-making
this is from the javascript api(wiki)

IMPORTANT: It should be noted that the node.save() API call is needed to persist the property modifications - all other modifications made using the API (e.g. content or adding aspects) take immediate effect.


Alfresco, can you check at this propery sheet problem?


friendly regards,

Nick