Announcement Announcement Module
Collapse
No announcement yet.
Best precices for Device and SitePreference controller arguements. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best precices for Device and SitePreference controller arguements.

    Finally i was able to get this thing right. Now my controllers are getting these arguments correctly. However, what i would like to know from other members who are developing mobile applications is....
    How do you combine these two arguments and display to the end user appropriate UI?
    Would you let SitePreference take precedent or do a complex if/else logic on Device and SitePreference variables to drive your UI?

    What i am thinking is to let Device argument decide the UI for the first time and let the SitePreference take over after that. But that is a complex if/else logic which looks like lot of code in controller handler methods.
    Is there a better option or approach?
    Thanks in advance.
    sri
    Last edited by srikondoji; Jul 13th, 2011, 10:28 AM. Reason: typo

  • #2
    Ah, got the answer. From what i understand from other blog post is that SitePreference will reflect Device by default. I was under the impression that SitePreference will be set to NORMAL by default.
    So simple if/else like below will be enough.
    if (sitePreference == SitePreference.MOBILE) {
    // prepare mobile view for rendering
    return "Welcome-mobile";
    }
    else {
    return "Welcome";
    }

    Thanks

    Comment

    Working...
    X