26 Feb 2014 5:54 AM #1
Unanswered: Best practice for dynamically changing views in an app based on server-supplied data?
I am about to write a ticketing application and want to use Sencha Touch for this.
The general work flow of buying a ticket is always the same, but depending on the event / location, additional details might be required from the buyer. For example, one location could provide additional delivery options and thus the client needs to display additional input fields and transmit the data back to the ticketing server in the web.
The information about what kind of additional information is required is stored on the server. This is necessary, because the information can change from one day to another.
My question is whether the following concept makes sense within sencha and what kind of caveats there might be:
I have a standard workflow for buying a ticket that is stored on the mobile application. After each step of the buying process I submit data to the server and sometimes request some data, e.g., available seats. The server will answer my query and also submit what kind of additional information he wants to have in the next step. This "workflow update" consists of a description of a view on some kind of abstraction level. Sencha Touch will then create a new view based on this workflow update and the buyer will enter the information as requested.
Are there any best practices for creating this workflow update, or should I arrange it totally different?
Thanks in advance for taking a look at this.
28 Feb 2014 7:10 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
All you would need to do is check the response and if the server returned extra items then just add them items to the base items for the next view. Shouldn't be too complicated.
Only caveat I see is if the mobile device looses connection like on a mobile network although it seems like your app will be transmitting data frequently so this is more of a larger issue of your app not this one technique.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.