动态< optgroup>支持wicket [英] Dynamic <optgroup> support in wicket

查看:208
本文介绍了动态< optgroup>支持wicket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用wicket在我的页面中呈现< select> 标记,但是将选项分组为< optgroup> ,这在 Wicket DropDownChoice中的分隔符上讨论过,但在解决方案中有< optgroup> 假设< optgroup> 标记是静态的,我想要同时从中提取选项和组数据库。

I'm looking to render a <select> tag in my page using wicket, but group the options with <optgroup>, this was discussed on Separator in a Wicket DropDownChoice, but in the solutions there the <optgroup> assume that the <optgroup> tags are static, I'm wanting to pull both the options and the groups from a database.

推荐答案

使用两个嵌套的转发器来迭代您的组和选项:

Use two nested repeaters to iterate over your groups and options:

<select wicket:id="select">
    <optgroup wicket:id="group">
        <option wicket:id="option"></option>
    </optgroup>
</select>

这篇关于动态&lt; optgroup&gt;支持wicket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆