开发者

Autocomplete controls in XForms

Can anyone please give me an idea on how to autocomplete input controls in XForms such that when a user begins typing words开发者_如何转开发 that begin that way appear?

Also how can I populate a control from the value of another control? Like in a drop down menu when a user selects a country name, the next field is automatically populated with that country's capital.

Country: Egypt City: Cairo (City should appear automatically)


XForms itself does not provide autocomplete functionality, but Orbeon Forms implements such a control with XBL and JavaScript. Here is the documentation.

The control has multiple modes, but you typically use it this way:

<fr:autocomplete ref="country-name" dynamic-itemset="false">
    <xforms:label>Enter a country name: </xforms:label>
    <xforms:itemset nodeset="instance('all-countries')/country">
        <xforms:label ref="name"/>
        <xforms:value ref="name"/>
    </xforms:itemset>
</fr:autocomplete>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜