【问题标题】:Orbeon: How to do checkbox list with optional text inputOrbeon:如何使用可选文本输入进行复选框列表
【发布时间】:2015-03-19 10:35:21
【问题描述】:

我需要从字典中做复选框列表,但我必须为每个选项添加可选的文本输入,如下所示:

<li>
  <label>
    <input type="checkbox" value="{id}"> {name}
  </label>
  <input type="text">
</li>

字典是这样的:

<items>
  <item>
    <id/>
    <name/>
  </item>
</items>

我尝试使用select 来实现,但我无法将文本输入放在每个项目旁边。我想我可以用repeat 做到这一点,但我不知道如何将复选框(仅限真/假)与文本输入连接。

【问题讨论】:

    标签: checkbox orbeon xforms


    【解决方案1】:

    我想您要问的问题是 XForms 的上下文,更具体地说是 Orbeon Forms,因为您已将问题标记为此类。因此,对于 XForms,这是通过选择控件完成的:

    <xf:select appearance="full" ref=".">
        <xf:itemset ref="instance('items')/item">
            <xf:label ref="name"/>
            <xf:value ref="id"/>
        </xf:itemset>
    </xf:select>
    

    另请参阅full source 的示例,您也可以使用run directly

    【讨论】:

      猜你喜欢
      • 2017-02-03
      • 2015-12-26
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 2020-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多