cancel
Showing results for 
Search instead for 
Did you mean: 

redirection after a script execution

alpha
Champ in-the-making
Champ in-the-making
hi guys!

i have created a new action that triggers a script (javascript) that launches an adhoc workflow.
It works (a workflow task is assigned to the pointed user) but when i run the action from the web client, a blank page is displayed with a single information :
org.mozilla.javascript.Undefined@1607a8a

I would like to know how i can set a redirection in javascript to display the browse screen.

Note : i call the script by node ref as follows

<action id="my_action">
            <label-id>sgedd_action_soumettre</label-id>
            <image>/images/icons/myaction.gif</image>
            <action>browse</action>
<script>workspace://SpacesStore/c861637b-cd68-11db-818a-af708f2ce9eb</script>
            <params>
               <param name="id">#{actionContext.id}</param>
            </params>
         </action>
        <action-group id="document_browse_menu">
            <action idref="my_action" />
         </action-group>
Any help is appreciated.
3 REPLIES 3

kevinr
Star Contributor
Star Contributor
We intend to add a return-page to the action definition in the future. For now it's easy enough though, just add this at the end of the script that your command uses:

var goback = "<script>history.back();</script>";
goback;

Thanks,

Kevin

alpha
Champ in-the-making
Champ in-the-making
thanks a lot it works pretty good :wink:

varsenault
Champ in-the-making
Champ in-the-making
Hello, in the new 2.1 version, is there a more elegant way to get back to previous page from a javascript action without doing this?

Thanks!