Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Android navigation issue

$
0
0

i am trying to update data and show an activity indicator while that happens on the same page i want hide the table view that i have created when the updates go on and then redirect the user to updated data page

i have been successful in updating the data and redirecting user to updated data page however when i update the data and get back to the select category page it shows the categories present in tableview but nothing can be clicked moreover even when i try to hide the tableview it cannot be hidden

my question is simple hide table view when data is being updated and when we get back from the view data page we can again see the categories and click to select another category.what wrong am i doing

this is the category page


and here is the videdata page
var currentWin = Ti.UI.currentWindow;
var prodName = Ti.UI.currentWindow.prodName;
//Ti.include('addData.js');
//alert('prodName');
//alert('viewdata open');
function setData() {    
 
    var db1 = Ti.Database.install('XMLDetails_Local.sqlite','XMLDATA');
 
    var rows = db1.execute('SELECT * FROM XMLDATA WHERE Category="' + prodName + '"');
 
    // create the array
    var dataArray = [];
 
    while (rows.isValidRow())
    {
        dataArray.push({id:'' + rows.fieldByName('id') + '', title:'' + rows.fieldByName('title') + '',hasChild:true, path:'ShowDetails.js',
        color: '#555555',font:{fontFamily:'Arial',fontWeight:'bold',fontSize:25}
 
        });
        rows.next();    
    };
 
    // set the array to the tableView
    tableview.setData(dataArray);
};
 
// create table view
var tableview = Ti.UI.createTableView({
});
 
tableview.addEventListener('click', function(e){
if (e.rowData.path){
var win = Ti.UI.createWindow({
url:e.rowData.path,
title:e.rowData.title
});
 
var tab1 = Titanium.UI.createTab({
icon:'images/tabs/KS_nav_ui.png',
title:'Products',
window:win
});
 
var prodName = e.rowData.id;
win.prodName = prodName;
tab1.open(win,{animated:true});
}
});
 
 
// add the tableView to the current window
currentWin.add(tableview);
 
// call the setData function to attach the database results to the array
setData();
Ti.App.addEventListener('reload',setData);
 
// currentWin.addEventListener('androidback', function(e){
    // //alert(e.source.id + " fired a " + e.type + " event");
     // var eventWin = Ti.UI.createWindow({
        // url:'Select_category.js',
        // title:'',
        // navBarHidden: true,  
        // _parent:Ti.UI.currentWindow,
        // modal:true
         // //backgroundColor:'#FFF',
        // });
   // currentWin.close();
   // eventWin.open();
//    
// });
 
 
var Questions = Titanium.UI.createButton({
    //backgroundImage:"images/background_button.png",
    bottom : '50',
    height:'42dp',
    width:'150dp',
    id:"Questions", //This is a custom property
});
 
Questions.addEventListener("click", function(e){
    alert(e.source.id + " fired a " + e.type + " event");
     var eventWin = Ti.UI.createWindow({
        url:'Applications/Select_category.js',
        navBarHidden: true, 
         backgroundColor:'#FFF',
        _parent:Ti.UI.currentWindow,
        modal:true
    });
   eventWin.open();
 
});
 
currentWin.add(Questions);

Viewing all articles
Browse latest Browse all 8068

Trending Articles