我有一个组合框,其值从托管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="
发布评论