1. Daniel Vivier
  2. PowerBuilder
  3. Friday, 19 November 2021 14:07 PM UTC

We have some autocomplete code in our base DW and a service object, for use in editable DDLB style columns in DWs, that works quite well, except for a few edge cases. I'm just wondering whether anyone has some bullet-proof proven code for that, that they would like to share, that we could try out to see whether it worked better than what we are using.

We're using PB2019 but this code has been working for a long time, through many versions!

An edge case that currently isn't working is if "TAB Accounting" is on the drop-down list, then you try to type in "Taylor": after the "a" it brings up "TAB Accounting", with the part after "TA" highlighted, then you cannot type a "y" to continue with "Taylor". (The code is supposed to be case-insensitive.) It's extremely hard to debug because there are so many events fired to make this work.

Thanks.

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Sunday, 21 November 2021 01:48 AM UTC
  2. PowerBuilder
  3. # Permalink

As promised, Dan, the "Enumerations" sample application is attached.

I'm intending to publish this app in CodeXchange, but it needs a little more polish before I submit it there. The code is reasonably well-documented, but if you have questions or experience any problems, please reply here. I hope this helps you out.

Attachments (1)
Comment
  1. John Fauss
  2. Friday, 26 November 2021 00:06 AM UTC
That's great news, Dan! You're welcome. I very much appreciate you letting me know the details of an example where the differences in upper/lower case results in an incorrect value. I'll see if I can address this issue prior to posting my example app on CodeXchange.
  1. Helpful
  1. John Fauss
  2. Friday, 3 December 2021 14:52 PM UTC
The "Enumerations" sample app is now available in the PowerBuilder section of CodeXchange. In addition to being able to supply a value that does not already exist in the child DataWindow, I added a feature that searches the child DataWindow contents using a case-sensitive search (normal operation uses a case-insensitive search). This might be a workable solution for the outlier case you described, Dan.
  1. Helpful 2
  1. Armeen Mazda @Appeon
  2. Friday, 3 December 2021 16:08 PM UTC
Thanks John!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Saturday, 20 November 2021 04:26 AM UTC
  2. PowerBuilder
  3. # 1

Hi, Dan -

I have a small, sample application that does this very thing. The drop-down search functionality is ostensibly a cleaned-up version of the PFC's drop-down search service, but the sample app does NOT use the PFC. It can handle your edge case where the user's input does not have to match an existing entry in the DDDW or DDLB. 

The app lists the item names and integer values that are defined for any PB enumerated type. A selection DataWindow uses the drop-down search functionality to help you identify/select the desired enumerated type from a DDDW. I'm thinking of posting the app to CodeXchange.

The code in the drop-down search functionality has NOT yet been tested extensively, but the logic comes from the PFC, which has been in use since PB 5, so I'm pretty confident it works well. Caveat emptor, however.

If you're interested in taking a look at it, I'll reply with the app in an attached zip file, as it will likely be another week or so until I have the app ready for publication in CodeXchange.

Best regards... John

Comment
  1. Daniel Vivier
  2. Saturday, 20 November 2021 12:50 PM UTC
Hi John. I'm not quite sure from this description whether your sample (or the PFC's code) also lets you just enter new values as well as match existing ones. We do need it to allow that. If it does that, then sure, we'd definitely appreciate seeing it. Thanks!
  1. Helpful
  1. John Fauss
  2. Saturday, 20 November 2021 15:05 PM UTC
You can configure it at runtime via an object function to work either way. I'll post it later today for you.
  1. Helpful 2
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 19 November 2021 15:57 PM UTC
  2. PowerBuilder
  3. # 2

 

it is disappointing that appeon has not put effort into making DDLB and DDDW work correctly with search as you type (with various options settable at runtime).  the way it currently 'works' out of the box is really really crappy.     

 

Services i've seen that try to make this work like a modern UI typically have problems like the one you see.  Was this the service from the PFC?

 

 

 

 

 

Comment
  1. Daniel Vivier
  2. Friday, 19 November 2021 16:46 PM UTC
Hey Mike. I looked today to see where I got the code from, and didn't find any comments answering that. It was so long ago that it's hard to remember. Maybe there were some suggestions in an article in the old PowerBuilder Developers Journal or something like that.



Actually staring at the code now I'm pretty sure I wrote it myself from scratch, as the comments are written the way I write. :) We actually haven't had an error report (like the edge case one we are currently trying to fix) for a long time so it must be extremely close to correct.



But yes this would be a great feature to have included in PB's functionality!
  1. Helpful
  1. Dan Harrel
  2. Friday, 19 November 2021 20:23 PM UTC
I've been asking for this for years and years at every opportunity I can - even before Appeon took over PB. This is really needed for modernizing PB windows clients, and I think this functionality needs to be in the DDDW implementation, not in PB code. Consider me to be asking again :) !
  1. Helpful 2
  1. Armeen Mazda @Appeon
  2. Friday, 26 November 2021 05:58 AM UTC
Hi Mike, Attend Elevate this year and maybe you be less disappointed? We got this feature on our roadmap!
  1. Helpful 2
There are no comments made yet.
Yida Zhang Accepted Answer Pending Moderation
  1. Friday, 19 November 2021 14:52 PM UTC
  2. PowerBuilder
  3. # 3

Windows 10 Pro 21H1, build 19043.1348.

PB2019 Standard Edition, build 2082.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 19 November 2021 14:40 PM UTC
  2. PowerBuilder
  3. # 4

Hi Dan;

  Can you tell us what release and build of the MS-Windows O/S and PB2019 that you are using?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.