从枚举中创建选择?

Creating selection-of from enum?

我希望创建一个输入视图,用户可以在其中选择枚举符号列表。

例如,我有有限数量的流派,所以我将它们放在一个枚举中,这些是 "Fantasy" 和 "Sci-fi"

之类的东西

我试过下面的代码,但没有任何显示;我查看了文档,但所有 selection-of 示例都是基于已有数据的概念。

有没有办法创建一个 selection-of input-view,用户可以 select 一个或多个项目,然后将其输出为一个概念?

input-view {
  match {
    GenreNames(gnames)
  }
  message (Select Genre(s))

  render {
    selection-of (gnames) {
      where-each (one) {
        single-line {
          text {
            value (one)
            style (Detail_M_Soft)
          }
        }
      }
    }
  }
}

试试这个:

input-view {
  match {
    GenreNames(gnames)
  }
  message (Select Genre(s))

  render {
    selection-of (gnames) {
      where-each (gnames) {
        single-line {
          text {
            value {
              template ("#{value(gnames)}")
            }
            style (Detail_M_Soft)
          }
        }
      }
    }
  }
}