PowerBuilder -- 如何在下拉列表中进行关键字搜索
我有一个下拉列表,其中包含数百个项目(字符串)。
当用户输入字母键时,下拉列表会选择带有该字母键的第一个字母字符串(这就是我想要的)。
问题是当用户输入另一个字母时,下拉列表不会继续搜索。
所以我的问题是如何让这些下拉列表一次搜索比搜索字母更多的内容。
谢谢!
I have a drop-down list which contains hundreds of items (Strings).
When a user enters a letter-key, the the drop-down selects the first alphabetic string with that letter-key (which is what I want).
The problem is when the users enters in another letter, the drop-down list does not continue the search.
So my question is how can you get these drop-down lists to search more than on letter at a time.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的答案的第一部分是,没有简单的属性可以设置来产生您想要的功能;您必须利用代码来创建它。
如果您使用的是 PowerBuilder 基础类 (PFC),则可以使用 DataWindow DropDown Search 服务,从调用 u_dw.of_SetDropDownSearch(TRUE) 开始。您需要查看 PFC 帮助文件以获取有关如何使用该服务的更多详细信息。
如果您不使用 PFC,您仍然可以从 Sybase 下载代码并将其改编为您的申请。您要开始查看的对象是 (pfcdwsrv.pbl)pfc_n_cst_dwsrv_dropdownsearch,以及 (pfemain.pbl)u_dw 如何调用后代 (pfedwsrv.pbl)n_cst_dwsrv_dropdownsearch。
非常基本上,在 EditChanged 事件中,服务
。您可能还想浏览该服务的更多内容。
祝你好运,
特里
The first part of your answer is that there is no simple attribute to set that will produce the functionality you're after; you'll have to leverage code to create it.
If you're using PowerBuilder Foundation Classes (PFC), you can use the DataWindow DropDown Search service, starting with calling u_dw.of_SetDropDownSearch(TRUE). You'll want to look at the PFC help file for more details on how to use the service.
If you don't use PFC, you can still download the code from Sybase and adapt it to your application. The object you'll want to start looking at is (pfcdwsrv.pbl)pfc_n_cst_dwsrv_dropdownsearch, and how (pfemain.pbl)u_dw calls the descendant (pfedwsrv.pbl)n_cst_dwsrv_dropdownsearch.
Very basically, on the EditChanged event, the service
There's more to the service that you'll probably want to browse.
Good luck,
Terry