Quantcast
Viewing all articles
Browse latest Browse all 8068

getting a fire event from inside a webview

Hi, I am trying to create a wysiwyg text editor using a script from nicEdit. My problem is figuring out how to get the text back from the text area. I have tried the following, but the fire event is not firing.

view file:

<WebView willHandleTouches="false" id="editor" top="40"></WebView>
and in my controller I have:
$.editor.html='<html><head><script src="nicEdit.js" type="text/javascript"></script><script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas); function getHtml(str){Ti.App.fireEvent("getText",{msg:str});}</script><style>.nicEdit-panelContain{padding-bottom:40px;}</style></head><body> <Textarea onblur="getHtml(document.getElementById(\"editArea\").value);" style="width:100%; height:25%" id="editArea" ></Textarea></body></html>';
 
Ti.App.addEventListener('getText',function(e) {
    Ti.API.info('here is a message from the webview : '+e.msg);
});
FYI, this is a tab based app for iOS, using Titanium 3.2.1

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>