Skip to main content

I have an entry box, which I use to create a search and put the results in a selection box.  For instance, user may type in 'EX' and get all of the listings that have that combo.

I want the users to be able to search for more than one combo, if they like, but I cannot get the selection box to clear.  I have tried initializing the table in cobol,  using delete-list-item, initializing in the dialog etc,  but the earlier entries won't go away. Below is an example with delete-occurrence.  There must be something simple I am overlooking.  Thx.

CLEAR-LOOP
  DELETE-OCCURRENCE ACCOUNT-GROUP $REGISTER
  DECREMENT ACCOUNT-COUNT
  DECREMENT $REGISTER
  REFRESH-OBJECT SB-ACCOUNT
  IF= $REGISTER 0 EXIT-CLEAR-LOOP
  BRANCH-TO-PROCEDURE CLEAR-LOOP
EXIT-CLEAR-LOOP

 


#selectionbox
#clear
#reset

I have an entry box, which I use to create a search and put the results in a selection box.  For instance, user may type in 'EX' and get all of the listings that have that combo.

I want the users to be able to search for more than one combo, if they like, but I cannot get the selection box to clear.  I have tried initializing the table in cobol,  using delete-list-item, initializing in the dialog etc,  but the earlier entries won't go away. Below is an example with delete-occurrence.  There must be something simple I am overlooking.  Thx.

CLEAR-LOOP
  DELETE-OCCURRENCE ACCOUNT-GROUP $REGISTER
  DECREMENT ACCOUNT-COUNT
  DECREMENT $REGISTER
  REFRESH-OBJECT SB-ACCOUNT
  IF= $REGISTER 0 EXIT-CLEAR-LOOP
  BRANCH-TO-PROCEDURE CLEAR-LOOP
EXIT-CLEAR-LOOP

 


#selectionbox
#clear
#reset

Did you try CLEAR-OBJECT instead of REFRESH-OBJECT?


Did you try CLEAR-OBJECT instead of REFRESH-OBJECT?

Hi Chris,

Yes I did. I used the name of the field, not the master name.  It did nothing.


Hi Chris,

Yes I did. I used the name of the field, not the master name.  It did nothing.

I wrote a little sample here that just populates a selection-box with 3 items and after I select an item it appears in the entry field of the selection box.

I execute the following dialog from a button which clears the entry field portion pf the selection box. This is working for me...

BUTTON-SELECTED
    CLEAR-OBJECT SB1
    MOVE " " DATA-FIELD


I wrote a little sample here that just populates a selection-box with 3 items and after I select an item it appears in the entry field of the selection box.

I execute the following dialog from a button which clears the entry field portion pf the selection box. This is working for me...

BUTTON-SELECTED
    CLEAR-OBJECT SB1
    MOVE " " DATA-FIELD

Hi,

I did the following in the dialog:

BUTTON-SELECTED

IFNOT= S-ACCOUNT " " CONT-LOOKUP-PROC

*

CONT-LOOKUP-PROC

MOVE ACCOUNT-COUNT $REGISTER

CLEAR-OBJECT SB-ACCOUNT

MOVE " " W-ACCOUNT

SET-MOUSE-SHAPE $WINDOW "SYS-Wait"

SET-FLAG SEARCH-ACCT-FLAG

RETC

INSERT-MANY-LIST-ITEMS SB-ACCOUNT ACCOUNT-GROUP ACCOUNT-COUNT

REFRESH-OBJECT $WINDOW

SET-MOUSE-SHAPE $WINDOW "SYS-Arrow"

[cid:image001.png@01D6AC4D.BB7E3C80]



I first enter 29, press the search button and get this result in the selection box.



22-2900000

22-2950000

22-2970000

22-2980000



Then I enter 27 and press the search button - and get the following in the selection box - the 29 lines are still there...

22-2900000

22-2950000

22-2970000

22-2980000



22-2700000

22-2760000



Hi,

I did the following in the dialog:

BUTTON-SELECTED

IFNOT= S-ACCOUNT " " CONT-LOOKUP-PROC

*

CONT-LOOKUP-PROC

MOVE ACCOUNT-COUNT $REGISTER

CLEAR-OBJECT SB-ACCOUNT

MOVE " " W-ACCOUNT

SET-MOUSE-SHAPE $WINDOW "SYS-Wait"

SET-FLAG SEARCH-ACCT-FLAG

RETC

INSERT-MANY-LIST-ITEMS SB-ACCOUNT ACCOUNT-GROUP ACCOUNT-COUNT

REFRESH-OBJECT $WINDOW

SET-MOUSE-SHAPE $WINDOW "SYS-Arrow"

[cid:image001.png@01D6AC4D.BB7E3C80]



I first enter 29, press the search button and get this result in the selection box.



22-2900000

22-2950000

22-2970000

22-2980000



Then I enter 27 and press the search button - and get the following in the selection box - the 29 lines are still there...

22-2900000

22-2950000

22-2970000

22-2980000



22-2700000

22-2760000


Sorry I misunderstood. I thought you simply wanted to clear the entry field portion of the selection box. If you wish to actually delete the entries within the listbox itself you need to use DELETE-LIST-BOX.

My updated example looks like this:

BUTTON-SELECTED
    CLEAR-OBJECT SB1
    MOVE " " DATA-FIELD
    DELETE-LIST-ITEM SB1 1 3
    RETC
    INSERT-MANY-LIST-ITEMS SB1 DATA-FIELD NUM-BYTES
    REFRESH-OBJECT SB1


Sorry I misunderstood. I thought you simply wanted to clear the entry field portion of the selection box. If you wish to actually delete the entries within the listbox itself you need to use DELETE-LIST-BOX.

My updated example looks like this:

BUTTON-SELECTED
    CLEAR-OBJECT SB1
    MOVE " " DATA-FIELD
    DELETE-LIST-ITEM SB1 1 3
    RETC
    INSERT-MANY-LIST-ITEMS SB1 DATA-FIELD NUM-BYTES
    REFRESH-OBJECT SB1

Thanks, sorry for the confusion.  That works great!  I had tried it before but was missing a parm!