首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在cfwheels中使用hasManyRadioButton()?

如何在cfwheels中使用hasManyRadioButton()?
EN

Stack Overflow用户
提问于 2013-05-29 15:30:34
回答 1查看 45关注 0票数 0

cfwheels文档指出,要使用hasManyRadioButton(),属性字段是必需的。但在他们的示例中,他们没有使用属性。

以下是cfwheels文档提供的example

代码语言:javascript
复制
<!--- Show radio buttons for associating a default address with the current author --->
<cfloop query="addresses">
    #hasManyRadioButton(
        label=addresses.title,
        objectName="author",
        association="authorsDefaultAddresses",
        keys="#author.key()#,#addresses.id#"
    )#
</cfloop>

property属性是否是必需的?使用此函数的正确约定是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-29 21:12:59

我认为property参数是必需的。这个例子似乎并不完整。

文档应该看起来像这样:

代码语言:javascript
复制
<!--- Show radio buttons for associating a default address with the current author --->
<cfloop query="addresses">
    #hasManyRadioButton(
        label=addresses.title,
        objectName="author",
        association="authorAddresses",
        keys="#author.key()#,#addresses.id#",
        property="isDefault",
        tagValue=true
    )#
</cfloop>

注意,我更改了association参数,以表明它可能是一个连接authoraddress的连接表。我还添加了propertytagValue参数。

在本例中,单选按钮设置子对象(在本例中为authorAddress模型)上的一些值。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16807959

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档