3

I am trying to create an input-view that will refresh every few seconds. The goal is to have a few buttons that increment and the user will click on the buttons when the buttons reach a 100. However, it seems like the action is waiting for an input so it is not updating. I found on the documentation that you can refresh an input-view, but I can't find any examples of it.

This is the code that I want to update:

input-view{
  match: State(state){
    to-input: UpdateGame
  }

  message{
    template ("#{value(state.display)}"){
      speech ("#{value(state.say)}")
    }
  }

  refresh{
    spec{
      delay-seconds (2)
      with-request{
        intent{
          goal: UpdateGame
        }
      }
    }
  }

  render{
    selection-of (state.options){
      where-each (option){
        cell-card{
          slot2{
            content{
              primary{
                template ("#{value(option)}")
              }
            }
          }
        }
      }
    }
  }
}
Angel
  • 61
  • 2

2 Answers2

2

There is one example of result-view in this doc

result-view {
  match {
    Activity (this)
  }
  refresh {
    if (!exists(this.receipt)) {
      spec {
        delay-seconds (5)
        with-request {
          intent {
            goal: CheckRideShareStatus
            value {$expr(this)}
          }
        }
      }
    }
  }
  conversation-drivers {
    if ("this.status == 'Requested' || this.status == 'Confirmed'") {
      conversation-driver {
        template ("Cancel my Uber ride")
      }
    }
  }
  render {
    layout-match (this) {
      mode (Details)
    }
  }
}
Gautam
  • 536
  • 4
  • 14
  • This is what I ended up doing. In addition, I used on-click events to receive input from the user, which worked out because I didn't need any of the input-view specific components. – Angel Nov 08 '19 at 20:11
1

Sorry I've not caught this question earlier.

I've just verified that this issue is fixed in 20B SDK release.

Please refer the release notes for details about other changes.