In my current app for Android I have an HTTP client that sends a request to a website and the JSON response is turned into a tableview. I have noticed that when I open the result window and move scroll across the table I actually have 2 identical tables one on top of the other. Another problem I’ve noticed is that when I press the android:back button the window closes and i get a black empty window, inorder to get the original main view I need to hit the back button again. added here are the main window code and the search result page.
thanks a bunch!
–the same question is posted on [appcelerator Q&A]
ok, the flow is like this:
1. the main window (win 1) opens, it has a search bar and 2 buttons. each button opens a different version of the same window (win 2).
- win 2 has a search bar and a few buttons.
if the search bar on any window (1 or 2) is filled and executed, a third window (win 3) is opened.
- in this window, an HTTP client (xhr) sends the proper request and the response text (JSON) is parsed and then fills a table view (tv).
the table view appears twice one on-top of the other and when i add an event that alerts the window it’s in i get “you are in search window” alert box twice.
when i click the back button, i get back an empty white window. if i click back button one more time i go back to the original window i came from.
–update: i re-wrote the whole thing but still nothing happens.
—-update: I added a flag to prevent the “onload” function to be called twice but this is just a hack.
I’m looking for a more fundamental answer
First, about ‘open’ event, which fires twice. There were a bug in version 1.8.0.1, when ‘open’ event fired twice (bugtracker), but it was fixed in version 1.8.1 (changelog). I have tested new version and all works good – ‘open’ event fires only once.
Second, about back button. As I see in your code you use tab.open. You can use ‘open’ directly for window, not for tab. And for iPhone you can create Navigation Group (wiki). Also remember to use HeavyWeight window, to make ‘back’ button work. You add modal:true property for this purpose, but try to use fullscreen:false.