cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Javascript action

rosh
Champ in-the-making
Champ in-the-making
I've created a custom action for send a mail.

When the user click on button Alfresco call the server action and send mail; when the action is completed Alfresco show a success popup message.
Is it possibile show a custom popup before the action is executed?
It's very important for give at user status feedback.

Thanks

Alfresco version is 4.0
2 REPLIES 2

parzgnat
Star Contributor
Star Contributor
Are you trying to configure an action in Share?  If so, then you can configure an action as a JavaScript action.  Because a JavaScript method is called when your action is clicked, this gives you the opportunity to make any presentation layer changes that you want (i.e. you can create popups, progress bars, etc.).  The typical control flow is that your JavaScript function will then make an AJAX request to an Alfresco webscript that does the actual work (in your case, sends an email).  Then upon success of the AJAX request, you can display a success message to the user in a popup.

Here is a link to a good tutorial that covers how to treat custom actions in Share.  It includes an example of a JavaScript action.
http://ecmarchitect.com/images/articles/alfresco-actions/actions-article-2ed.pdf

rosh
Champ in-the-making
Champ in-the-making
Thanks for your response Parzgnat!
Then to create my UI action that sends an email, I should do these steps:
1)write an action executer class;
2)configure the action in spring;
3)specify a custom client-side javascript component in share-config-custom.xml
4)write the javascript component.
Is it ok?