Skip to Content

Skip list screen and go directly to detail screen

A lot of times I don't need the list screen, because only one item is available.

Now I would like to skip the list screen and go to the detailscreen.

I thought to use the api navigateForward(toScreen, listViewKey) for this, but in which method do I have to put this api in the custom.js file and how can I declare that the first row should be displayed in the detail screen.

An example would be appreciated.

Marcel

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 28, 2011 at 05:55 PM

    You could add in something like the following pseudo-code into customBeforeNavigateForward:

    if (destScreenKey === "MyListviewScreen")

    {

    var mvc = getCurrentMessageValueCollection();

    var data = mvc.getData("MyListviewKey");

    if (data.getValue().length == 0)

    {

    navigateForward("MyListviewDetailsScreen", data.getValue()[0].getKey());

    return false;

    }

    }

    return true;

    I haven't tested this, but the principle should be sound.

    Add comment
    10|10000 characters needed characters exceeded