Skip to main content

Auto-complete ENTRY-FIELD

  • February 10, 2011
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 08 February 2011]

This issue was posted by Sal Cambareri on the old Forum and I have reproduced it here because it is exactly what we want to do (Hope you don't mind Sal).

Sal's issue
If you aren't familiar with it, their auto-completion entry field looks like a combination entry-field/list box. As the operator types characters into the entry-field two things happen: The program suggests completion characters after the last character typed and a drop down list box appears with suggested values for the field. The operator can continue typing, press tab to take the automatic completion or click on any entry in the list box to fill the entry-field.
(The Google search entry provides a similar, simpler, version of the same type of control. It would be acceptable to us too.)
We are open to any suggestions including but not limited to ActiveX controls and other third party products or consulting services. We are looking to integrate this into our large inventory of AcuCobol GUI dependent programs, so for now .net and other replacements for the AcuCobol GUI are not our our first choices.

The response was to use a .NET control but as we are in the process of moving our UI to Java, we don't want to get involved in .NET controls. We do however want to find a Cobol solution as an interim step.

There are a few ways we can think of to do this, but it is more a matter of doing it in the most efficient way.

Has this been done before ? Can anyone suggest anything in Extend 8 or 9 ?

4 replies

Stephen Hjerpe
  • Participating Frequently
  • February 10, 2011

[Migrated content. Thread originally posted on 08 February 2011]

This issue was posted by Sal Cambareri on the old Forum and I have reproduced it here because it is exactly what we want to do (Hope you don't mind Sal).

Sal's issue
If you aren't familiar with it, their auto-completion entry field looks like a combination entry-field/list box. As the operator types characters into the entry-field two things happen: The program suggests completion characters after the last character typed and a drop down list box appears with suggested values for the field. The operator can continue typing, press tab to take the automatic completion or click on any entry in the list box to fill the entry-field.
(The Google search entry provides a similar, simpler, version of the same type of control. It would be acceptable to us too.)
We are open to any suggestions including but not limited to ActiveX controls and other third party products or consulting services. We are looking to integrate this into our large inventory of AcuCobol GUI dependent programs, so for now .net and other replacements for the AcuCobol GUI are not our our first choices.

The response was to use a .NET control but as we are in the process of moving our UI to Java, we don't want to get involved in .NET controls. We do however want to find a Cobol solution as an interim step.

There are a few ways we can think of to do this, but it is more a matter of doing it in the most efficient way.

Has this been done before ? Can anyone suggest anything in Extend 8 or 9 ?
This may be difficult to make, although conceptually speaking you may consider using a grid control, make a single row, single column grid. By doing so, you now have access to all of the grid events, so you should be able to monitor when an additional key is entered and then you can via your event routines offer suggestions into that grid cell.

[Migrated content. Thread originally posted on 08 February 2011]

This issue was posted by Sal Cambareri on the old Forum and I have reproduced it here because it is exactly what we want to do (Hope you don't mind Sal).

Sal's issue
If you aren't familiar with it, their auto-completion entry field looks like a combination entry-field/list box. As the operator types characters into the entry-field two things happen: The program suggests completion characters after the last character typed and a drop down list box appears with suggested values for the field. The operator can continue typing, press tab to take the automatic completion or click on any entry in the list box to fill the entry-field.
(The Google search entry provides a similar, simpler, version of the same type of control. It would be acceptable to us too.)
We are open to any suggestions including but not limited to ActiveX controls and other third party products or consulting services. We are looking to integrate this into our large inventory of AcuCobol GUI dependent programs, so for now .net and other replacements for the AcuCobol GUI are not our our first choices.

The response was to use a .NET control but as we are in the process of moving our UI to Java, we don't want to get involved in .NET controls. We do however want to find a Cobol solution as an interim step.

There are a few ways we can think of to do this, but it is more a matter of doing it in the most efficient way.

Has this been done before ? Can anyone suggest anything in Extend 8 or 9 ?
you discriped it looks like a entry-field and a list-box :)
why don't use a entry-field and a list box?

Example:

WS:
       77  elist                                 handle of list-box.
       77  b-test            pic x(30)           value spaces.

SS:
           03  eentry, entry-field using b-test,
               line 1, col 30, max-text 30,
               notify-change, exception procedure autofill-handle.

Prog:

      ***********************************************************
       autofill-handle section.
           evaluate event-type
              when ntf-changed
                   display list-box, line 1,9, col 30, size 30 no-box,
                   lines 5, handle in elist

                   perform autofill-data
              when other
                   continue
           end-evaluate.

       autofill-handle-ende.
           exit.
       autofill-handle-e.
      ***********************************************************
       autofill-data section.
           modify elist, item-to-add "test1".
           modify elist, item-to-add "test2".
           modify elist, item-to-add "test3".

           call "c$sleep" using 3,0 end-call.

           destroy elist.

       autofill-data-ende.
           exit.
       autofill-date-e.
      ***********************************************************


so i created a entry field with notify-change to fetch every input.
when a input is created i create a list-box which shows the auto-complete results.

when the list-box is no more needed i destroy it.
The TAB-Function and so on is still missing, but i think it should be possible.


[Migrated content. Thread originally posted on 08 February 2011]

This issue was posted by Sal Cambareri on the old Forum and I have reproduced it here because it is exactly what we want to do (Hope you don't mind Sal).

Sal's issue
If you aren't familiar with it, their auto-completion entry field looks like a combination entry-field/list box. As the operator types characters into the entry-field two things happen: The program suggests completion characters after the last character typed and a drop down list box appears with suggested values for the field. The operator can continue typing, press tab to take the automatic completion or click on any entry in the list box to fill the entry-field.
(The Google search entry provides a similar, simpler, version of the same type of control. It would be acceptable to us too.)
We are open to any suggestions including but not limited to ActiveX controls and other third party products or consulting services. We are looking to integrate this into our large inventory of AcuCobol GUI dependent programs, so for now .net and other replacements for the AcuCobol GUI are not our our first choices.

The response was to use a .NET control but as we are in the process of moving our UI to Java, we don't want to get involved in .NET controls. We do however want to find a Cobol solution as an interim step.

There are a few ways we can think of to do this, but it is more a matter of doing it in the most efficient way.

Has this been done before ? Can anyone suggest anything in Extend 8 or 9 ?
Thanks for the suggestion. It is what we ended up doing and once we have completed it I will post the program on the Forum. We have some tidying up to do in terms of making the transition between entry field and list box as seamless as possible. What I want it to eventually look like is a combo box with notify-change property

[Migrated content. Thread originally posted on 08 February 2011]

This issue was posted by Sal Cambareri on the old Forum and I have reproduced it here because it is exactly what we want to do (Hope you don't mind Sal).

Sal's issue
If you aren't familiar with it, their auto-completion entry field looks like a combination entry-field/list box. As the operator types characters into the entry-field two things happen: The program suggests completion characters after the last character typed and a drop down list box appears with suggested values for the field. The operator can continue typing, press tab to take the automatic completion or click on any entry in the list box to fill the entry-field.
(The Google search entry provides a similar, simpler, version of the same type of control. It would be acceptable to us too.)
We are open to any suggestions including but not limited to ActiveX controls and other third party products or consulting services. We are looking to integrate this into our large inventory of AcuCobol GUI dependent programs, so for now .net and other replacements for the AcuCobol GUI are not our our first choices.

The response was to use a .NET control but as we are in the process of moving our UI to Java, we don't want to get involved in .NET controls. We do however want to find a Cobol solution as an interim step.

There are a few ways we can think of to do this, but it is more a matter of doing it in the most efficient way.

Has this been done before ? Can anyone suggest anything in Extend 8 or 9 ?
Using the paired entry-field/list-box concept, I did come up with our own "Auto-complete field" that mimics the Intuit auto-complete very nicely. I figured out that I needed NOTIFY-CHANGE in the entry field, but the key clue was provided by Randy Zack who pointed me to the CURSOR-COL clause. With proper use of it I was able to code the "auto-complete field" so that as the operator types characters into the entry field, the program fills the entry field with the first complete stored value that matches the characters typed up to the cursor position. The CURSOR-COL also enables me to fill the list box with only the items that match the characters up to the CURSOR-COL value. Using the Acu BEFORE, AFTER, EXCEPTION screen section clauses coupled with the SET KEYSTROKE feature, I was able to provide arrow-key navigation into the list box as well as use of the Del key to delete bad items from the stored values used for the list box display.
I am a bit proud of the code and would like nothing better that to share the code here. Unfortunately, an unhappy history of litigation at our 30 year old company has led us to a policy of not publishing source. I would be happy to answer any questions short of providing source. (The company does sell source accompanied by a non-disclosure agreement, but that's not my department.)
Regards,
Sal Cambareri