AnsweredAssumed Answered

client feedback after js execution

Question asked by tfaudot on Jul 11, 2008
Hello,

I've added a js script called when a user clicks on a link, I followed strictly the examples as shown in http://wiki.alfresco.com/wiki/Externalised_Client_Actions but I don't like the "goback" thing as there is no feedback for the user !
I would like my user to know that the script was executed successfully by notifying him just as I would do with a Utils.addStatusMessage(…) in java.
is it possible to call such a method in javascript? is there any other way around?

Edit:
I tried something following the "adding custom scripts API" in the wiki (http://wiki.alfresco.com/wiki/JavaScript_API#Adding_Custom_Script_APIs).
here's what I did:
package org.alfresco.web.ui.common;

import javax.faces.application.FacesMessage;

import org.alfresco.repo.processor.BaseProcessorExtension;

public class MyUtils extends BaseProcessorExtension {
   public void javaLog(String msg){
      Utils.addStatusMessage(FacesMessage.SEVERITY_INFO, msg);
   }
}

and registered the bean as follows:
<bean id="myutils" parent="baseJavaScriptExtension" class="org.alfresco.web.ui.common.MyUtils">
   <property name="extensionName">
       <value>myutils</value>
   </property>
   </bean>

Then on my script I try to invoke my new method:
myutils.javaLog("hahaha");

I got no errors in the output, all seems fine but my message doesn't display as it should.
Any ideas on the matter?

Thanks!

Outcomes