Xpages Combobox

编程入门 行业动态 更新时间:2024-10-25 00:31:41
Xpages Combobox - 设置默认值(Xpages Combobox -setting the default value)

我有一个组合框,其值从托管bean填充,如下所示:

keywordlist.setConnDB("jdbc:sqlserver://xx.xx.x.xx:1433;DatabaseName=xxx"); keywordlist.setConnUserName("xxx"); keywordlist.setConnPassword("xxx"); keywordlist.setSQLQuery("SELECT DisplayText as Keyword From Glossary WHERE SUBSTRING(DisplayText, 1, 2)= 'RV'"); keywordlist.keywords;

我希望能够将默认值设置为“---选择---”,但无论我做什么,关键字列表总是选择返回的第一个关键字作为默认值。

任何援助将不胜感激。

谢谢,

I have a combobox with values being populated from a managed bean like so:

keywordlist.setConnDB("jdbc:sqlserver://xx.xx.x.xx:1433;DatabaseName=xxx"); keywordlist.setConnUserName("xxx"); keywordlist.setConnPassword("xxx"); keywordlist.setSQLQuery("SELECT DisplayText as Keyword From Glossary WHERE SUBSTRING(DisplayText, 1, 2)= 'RV'"); keywordlist.keywords;

I'd like to be able to set the default to '--- Select ---', but no matter what I do the keyword list always picks the first of the returned keywords as the default.

Any assistance would be much appreciated.

Thanks,

Dan

最满意答案

添加另一个值对(在第一个位置),使用以下SSJS返回值键入“公式项”:

"-- Select --|"

注意管道! 这应该在第一个位置显示,也应该默认为“空”是默认值。 如果没有,请将“别名”(管道后面的值)设置为您可以定义为组合项的默认值porperty的内容。

Add another value pair (on first position), type "formula item" with the following SSJS return value:

"-- Select --|"

Notice the pipe! That should display this at first position and should also be defaulted as "empty" is the default value. If not, set the "alias" (the value after the pipe) to something that you can define as default value porperty for the combo item.

更多推荐

keywordlist,keywords,default,电脑培训,计算机培训,IT培训"/> <meta name="

本文发布于:2023-08-04 12:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1416107.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Xpages   Combobox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!