Not able to call java script from updateFromUIDL () method in custom widget

Hi All,
I am doing a Flex and Vaadin integration by following the tutorial provided in vaadin website. i am invoking a native javascript API from my custom widget’s updateFromUIDL method as below. fxcoverflow" + id].displayText(text.toString() method is inside the SWF file. It seems somehow the javascript invocation is obfuscated and it says the method not found

“JavaScriptException: (TypeError): $doc[$intern_33 + this.com_example_flexvaadinintegration_client_ui_VFlex_uidlId]
.displayText is not a function”

final public native void displayText(String id, String text) /-{
$doc[“fxcoverflow” + id]
.displayText(text.toString());
}-
/;

public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
if (client.updateComponent(this, uidl, true)) {
return;
}

        // Save reference to server connection object to be able to send
        // user interaction later
        this.client = client;

        // Save the UIDL identifier for the component
        uidlId = uidl.getId();	        
      
        
        String xml=uidl.getStringVariable("xml");	       

        setFlash();
    	initializeMethods();	    	
    	 if(xml!=null){
	        	displayText(uidlId,xml);
    		 ///this.xml=xml;
	   }
	
}

Please help me to resolve this error.

Thanks,
Nedu

Have you made the displayText-method externally available in your Flex application using ExternalInterface.addCallback -method?

Sorry for the long delay. Since i was working on a release couldn’t follow this.

Yes i have made this method externally accessible. Please find the code below

       public static function addJSCallback(jsFunctionName:String, flexFunction:Function):void {
	try {
		 if (ExternalInterface.available) {
		   ExternalInterface.addCallback(jsFunctionName, flexFunction);
		 }
		} catch (error:SecurityError) {
		 trace("Couldn't add javascript callback: " + error);
		}
	}


	public function displayText(text:String):void {
		textWidget.text = text;
	}	 
	private function init():void {
		addJSCallback("displayText", displayText);
	}