Plone 4的Archetypes AutoComplete Widget

时间:2011-06-30 08:53:53

标签: autocomplete plone archetypes

我的自定义原型内容类型需要自动完成小部件,但我还没有找到Plone 4兼容产品。有什么建议吗?或者,如果我必须升级那些旧的小部件产品,提示的任何好例子或资源?

1 个答案:

答案 0 :(得分:2)

我在已经从3.3.x迁移的plone 4.0.7项目中使用Products.AutocompleteWidget 1.3并且运行良好。所以不需要升级它。

relatedTopicsField = ReferenceField(
        name = 'relatedTopics',
        relationship = 'belongsToTopics',
        multiValued = True,
        isMetadata = True,
        index = 'KeywordIndex',
        write_permission = ModifyPortalContent,
        allowed_types = ['MyType'],
        vocabulary_factory = 'my.types.TopicVocabulary',
        enforceVocabulary = 1,
        required = True,
        widget = AutocompleteWidget(
            label = _(u"Topics"),
            description = _(u"Choose the topics this item is related to."),
            visible = {'edit' : 'visible', 'view' : 'invisible' },
            actb_timeout = 50000,
            actb_lim = 7,
            )
        )