question

Mark Beauchamp avatar image
Mark Beauchamp asked

Using the AlexaPaginatedList template, how can I set the AlexaPageCounter property values?

Using the AlexaPaginatedList template, is it possible to update the AlexaPageCounter currentPage and totalPages property values, presumably via SetValue?

My skill returns item results in sets of 5 on each conversation turn. The user can then request the next (or previous) set of 5 result items. Each item is rendered as a page using the AlexaPaginatedList template. So given 25 result items, I'd want the paginator to display "1|25" for the first result item of five rendered on that turn, and "6|25" on the next turn for the sixth result item, and so forth.

If possible, this is what I imagine the APL might look like, but I'm only guessing. Does the paginator have it's own Id?

{
  "type": "APL",
  "version": "1.7",
  "import": [
    {
      "name": "alexa-layouts",
      "version": "1.4.0"
    }
  ],
  "mainTemplate": {
    "parameters": [
      "alexaPaginatedListData"
    ],
    "items": [
      {
        "navigation": "none",
        "onMount": [
          {
            "type": "SetValue",
            "componentId": "customAlexaPaginatedListId",
            "property": "totalPages",
            "value": 6
          },
          {
            "type": "SetValue",
            "componentId": "customAlexaPaginatedListId",
            "property": "currentPage",
            "value": 4
          }
        ],
        "type": "AlexaPaginatedList",
        "listId": "customAlexaPaginatedListId",
        "headerTitle": "AutoPage Test",
        "headerAttributionPrimacy": false,
        "backgroundScale": "best-fill",
        "backgroundAlign": "bottom",
        "theme": "dark",
        "listItems": [
          {
            "primaryText": "Home Garden Item 4",
            "imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/templates_v3/paginatedlist/PaginatedList_Dark1.png"
          },
          {
            "primaryText": "Home Garden Item 5",
            "imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/templates_v3/paginatedlist/PaginatedList_Dark2.png"
          },
          {
            "primaryText": "Home Garden Item 6",
            "imageSource": "https://d2o906d8ln7ui1.cloudfront.net/images/templates_v3/paginatedlist/PaginatedList_Dark3.png"
          }
        ]
      }
    ]
  }
}
apl
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jason@Amazon avatar image
Jason@Amazon answered

I don't think this is possible - the responsive layouts don't have any parameters you can set other than what's listed on the documentation, so you'd have to created your own template in order to achieve this.

10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.