I am very new to titanium when i am trying to exit from the application by clicking the button it displays the titanium splash screen again!!
I am using the following code
var win=Ti.UI.createWindow({
backgroundColor:'#ddd',
exitOnClose:true
});
var button=Ti.UI.createButton({
title:'back',
left:10,top:10
});
button.addEventListener('click',function(e){
win.close();
});
var text=Ti.UI.createLabel({
text:'Home page',
color:'#000',
font:{ fontSize:20}
});
win.add(button);
win.add(text);
win.open();
How can I exit from the application through button click?
You can simply close the application by adding following property to the first window of your application.
exitOnClose: true
and then type the following code where you close your window
win.close();
var activity = Titanium.Android.currentActivity;
activity.finish();
Reference : Exit from Titanium Application Android.
Hope it solved your problem!!
Related
I am trying to open reply email using DisplayReplyAllForm, it is showing popup blocker alert in IE and Edge.
Office.context.mailbox.item.displayReplyAllForm(
{
'htmlBody' : emailBodyHtml,
'callback' : function(asyncResult)
{
console.log('reply mail with asyncResult.value ==> ' + asyncResult);
}
});
I am trying to execute this code in a function which will be called by button onclick handler.
Error View :
This is stopping us from app store submission. What is the fix for this?
I am currently working on a project in titanium .I wish to open url in default browser of BB10
simulator instead of webview used in the app on click event .I am using the following code
var win =Ti.UI.createWindow({
title:'Test'
});
var webview=Ti.UI.createWebView({
url:"http://demo.php.otssolutions.com/videoapp-uat/home"
});
win.add(webview);
webview.addEventListener('click',function(e){
var url=e.url;
Ti.API.info(url);
Titanium.Platform.openURL("http://demo.php.otssolutions.com/videoapp-uat/home");
});
win.open();
Thanks in advance for any help
I'm filling a form using casperjs and getting stuck at its submission. Below is my code snippet:
this.then(function(){
this.waitUntilVisible('#ajaxSignin', function(){
this.capture("snapss.png");
this.fill('form#ajaxSignin', {
'j_username' : 'testings123testings#gmail.com',
'j_password' : '1234rewq'
}, true);
});
});
this.thenClick('#signin_submit');
this.then(function(){
this.wait(10000, function(){
this.capture('sn8.png');
});
});
In the image 'sn8.png', I'm getting this: "HTTP Status 405 - Request method POST not supported".
So I infer that there is something wrong in clicking the submit button. The script works fine till form filling.(site link: 'http://www.snapdeal.com/product/haier-le22t1000-22-inches-hd/1380076?pos=0;372')
this.waitUntilVisible('#ajaxSignin', function(){
this.capture("snapss.png");
this.fill('form#ajaxSignin', {
'j_username' : 'testings123testings#gmail.com',
'j_password' : '1234rewq'
}, true); // change this to false true will sumbit the
// form right after the input was set
You are submitting the form before you click on the #signin_submit button.
I have the following code to load a file after creating a web page which displays a WebGL canvas:
// Load ccconnect.js file
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4){
eval.call( Window, xmlhttp.response );
}
};
xmlhttp.open("GET","../ccconnect.js",true);
xmlhttp.send(null);
It works fine in Chrome but Safari brings up an error saying:
ReferenceError: Can't find variable: Window
on the line eval.call(...). The ccconnect.js code is displayed when I hover the mouse over 'response' on that same line when debugging so it seems to have retrieved it. Any idea what is wrong? I'm using Safari 5.1.5.
both window and Window is the global object both are understand by other browsers.
but when I checked in safari, it don't understand the variable Window. So my suggestion is replace Window with window.
Do anyone have an idea about, how to register the window unload event in an ExtJS MVC application.
Ext.EventManager.on(window, 'beforeunload', function() {
alert('cross-exit tab click AND cross-exit browser click');});
The above code needs to be placed in a javascript file. I'm not sure which file should carry the above code.
window.onbeforeunload = function() {
return "You have made changes, are you sure you would like to navigate away from the page?";}.bind(this);
The above code does the job. I placed it under my main controller.
Put it in controller just inside init method:
init: function(){
Ext.EventManager.on(window, 'beforeunload', function() {
this.setAllValues(false);
});
this.control({
............
....