|
|
|
Re: getDataByText() for SmartFields with CodeTypes [message #1440489 is a reply to message #1440423] |
Wed, 08 October 2014 12:37 |
Jeremie Bresson Messages: 1252 Registered: October 2011 |
Senior Member |
|
|
Hi Urs,
Judith Gull wrote on Wed, 08 October 2014 12:47You can also set IDesktop.setAutoPrefixWildcardForTextSearch(boolean), if this behaviour is for all searches.
As Judith said, if for all your lookupcall, you want to match the entered text like a "contains" operation, and not a "start with" you can just add this line at the beginning of Desktop#execOpened():
@Override
protected void execOpened() throws ProcessingException {
setAutoPrefixWildcardForTextSearch(true);
//... rest of the method
If you debug, you will see that the client adds 2 wildcard char "*" before and after the String entered by the user. This will be true for all the SmartFields in your application (SmartFields working with CodeTypes or with LookupCalls).
Urs Beeli wrote on Wed, 08 October 2014 13:32There is one stumbling block: getSearchPattern() is static, so it can't be overwritten in a derived class. Is there a reason for it being static?
In my opinion, no reason at all. You can open a bug to fix this.
The fix is trivial:
- Mark "public static Pattern getSearchPattern(String s)" as deprecated [will be removed with N-Release].
- Create a replacement method "protected Pattern createSearchPattern(String s)" as replacement (copy paste from the old one with another signature).
- Change the code to use your new method.
This is a small but useful step into making scout better. We need those small contributions in order to improve our code base.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03993 seconds