SplitWindow: close detailview window from masterview

You must Login before you can answer or comment on any questions.

Hi, verybody I have an iPad app with a SplitWindow. In detailView at left I have a form with some buttons and in masterView at right there is a navGroup with windows, that the user can open and close. NavGroup shows the result of the form of detailWindow, in a list, and from this list the user can click to see the item details. I have declared all windows in navgroup with _parent and root and all run ok, but when i´m in the item detail, if I push again the form buttons in the left, there is no changes on the navgroup at the right, but, If i click on back buttons on the right until the root window, the form buttons runs again ok. The question How can I close the navGroup window, (or go back to root window) from a button in detailWindow.? Is there any commucation between masterview and detailview?

Thanks you very much!

1 Answer

I answer myself: The problem was I declared the window out of the click event, but if I declare the window var into the click event the problen is solved: a new window appears always over the previus window.

I did this at the begining:

var listWindow = Ti.UI.createWindow({
    backgroundColor:'#a50d1d',
    url:'listados.js',      
    barColor:'#a50d1d',
    _parent: winRight,
    navGroup: navGroup,
    rootWindow: winRight
 });
botonVertodos.addEventListener('click', function(e) {
    listWindow.valores = valorglobal;   
    navGroup.open(listWindow,{animated:true});  
});
But the correct way is:
botonVertodos.addEventListener('click', function(e) {
var listWindow = Ti.UI.createWindow({
    backgroundColor:'#a50d1d',
    url:'listados.js',      
    barColor:'#a50d1d',
    _parent: winRight,
    navGroup: navGroup,
    rootWindow: winRight
 });
    listWindow.valores = valorglobal;   
    navGroup.open(listWindow,{animated:true});  
});
In that way I can always open a new window at right from the left side of the splitview

Your Answer

Think you can help? Login to answer this question!