挂毯广播集团
我无法让 Tapestry 4 无线电组正常工作。
我的 HTML
<td><span jwcid="activeServerRadioGroup"></span></td>
<td><input type="radio" jwcid="activeServerRadio" /></td>
我的 .page
<property name="activeServer"/>
<component id="activeServerRadioGroup" type="RadioGroup">
<binding name="selected" value="activeServer.selected"/>
</component>
<component id="activeServers" type="For">
<binding name="source" value="activeServers"/>
<binding name="keyExpression" value="literal:id"/>
<binding name="value" value="activeServer"/>
<binding name="element" value="literal:tr"/>
</component>
<component id="activeServerRadio" type="Radio">
<binding name="value" value="activeServer.id"/>
</component>
在我的 .java 文件中 我有一个 getActiveServers() 方法,它返回具有选定的 id 属性的自定义类列表。上面的结构不起作用。有人可以帮忙吗?
I am unable to get the tapestry 4 radio group working.
My HTML
<td><span jwcid="activeServerRadioGroup"></span></td>
<td><input type="radio" jwcid="activeServerRadio" /></td>
My .page
<property name="activeServer"/>
<component id="activeServerRadioGroup" type="RadioGroup">
<binding name="selected" value="activeServer.selected"/>
</component>
<component id="activeServers" type="For">
<binding name="source" value="activeServers"/>
<binding name="keyExpression" value="literal:id"/>
<binding name="value" value="activeServer"/>
<binding name="element" value="literal:tr"/>
</component>
<component id="activeServerRadio" type="Radio">
<binding name="value" value="activeServer.id"/>
</component>
In my .java file
I have a method getActiveServers() that returns a list of custom class with selected, id attributes. The above structure is not working. Can somebody help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您没有详细描述您的问题,但这是我的猜测:
1. Radio 必须放在 RadioGroup 内
2. RadioGroup 的“selected”参数必须设置为服务器 id
在您的页面类中:
3. 也许您甚至不应该使用RadioGroup?
RadioGroup 仅用于从列表中选择一个对象。根据您的描述,听起来您可以同时拥有多个活动服务器。在这种情况下,也许复选框列表会更好?
You did not describe your problem in much detail, but here's my guess:
1. Radio must be put inside a RadioGroup
2. The "selected" parameter of RadioGroup must be set to a server id
And in your page class:
3. Perhaps you should not even be using RadioGroup?
RadioGroup is only used to select one single object from a list. From your description it sound like you can have several active servers at a time. In that case, perhaps a list of checkboxes would be better?