1. #1
    Sencha Premium Member
    Join Date
    Jan 2014
    Posts
    1
    Vote Rating
    0
    thehaep is on a distinguished road

      0  

    Default Unanswered: Best practice for dynamically changing views in an app based on server-supplied data?

    Unanswered: Best practice for dynamically changing views in an app based on server-supplied data?


    Hi all,

    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.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,220
    Answers
    3521
    Vote Rating
    859
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    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 services@sencha.com

    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.

Thread Participants: 1