Strange problem: Browse Cell Combo-Box

TekkamanOmega

New Member
Hello,

I have encountered some strange and annoying behavior with browse cells.

A bit of sample code:
Code:
CLASS SomeClass:
  DEFINE PRIVATE VARIABLE pBrowse AS WIDGET-HANDLE NO-UNDO.
 
  /* More code... */
 
  METHOD PUBLIC VOID setColumn(pBuffer AS HANDLE, pFields AS CHAR):  
    DEFINE VARIABLE whColumn AS HANDLE NO-UNDO.
    ASSIGN whColumn = pBrowse:ADD-LIKE-COLUMN(pBuffer:BUFFER-FIELD("contextNumber"), 0, "COMBO-BOX")
           whColumn:READ-ONLY = FALSE
           whColumn:WIDTH-PIXELS = pWidth.
           whColumn:LIST-ITEM-PAIRS = pFields.
  END METHOD.
END CLASS.

When pFields is filled with for example:
"Firma,Company,Nummer,ReturnID,Klant,Customer,Invoerdatum,EntryDate,Einddatum,DueDate,Factuur,InvoiceNumber"

After it is assigned to the column's LIST-ITEM-PAIRS, the contents of LIST-ITEM-PAIRS are:

"Firma,C,Nummer,R,Klant,C,Invoerdatum,E,Einddatum,D,Factuur,I"

So, the values are changed to the first character of it's string entry. Sometimes they are like this, sometimes it is filled normally.

Can anyone help me with this issue?

Kind regards,
Tekka.
 
Differences between LIST-ITEMS and LIST-ITEM-PAIRS, Combo Box attribute (BROWSE widget (column), COMBO-BOX widget) are.
cCombo:LIST-ITEMS = "red,green,blue".
screen-value of the combo will be red or green or blue, depending of what the user has selected.
on the other hand if
cCombo:LIST-ITEM-PAIRS = "red,1,green,2,blue,3"
screen value when the user selected green will be 2.
LIST-ITEMS is for single values, while LIST-ITEM-PAIRS will be for pair of values: key=value.
So try to display LIST-ITEMS instead of LIST-ITEM-PAIRS
 
Thanks for your reply, enoon.
Unfortunately what you answer will not help me.
I need to keep LIST-ITEM-PAIRS because the key value is a field in a table and the displayed value in the combo box is something the user needs to be able to undestand.

Sometimes it just works normally with LIST-ITEM-PAIRS but on some unidentified occasions the key values of ever LIST-ITEM-PAIR is abbreviated to just the first Character.

Example if I were to display a message of whColumn:LIST-ITEM-PAIRS after the assign in the example above it would display me the following string:
"Firma,C,Nummer,R,Klant,C,Invoerdatum,E,Einddatum,D,Factuur,I"

Whereas the original input string is:
"Firma,Company,Nummer,ReturnID,Klant,Customer,Invoerdatum,EntryDate,Einddatum,DueDate,Factuur,Invoic eNumber"

Anyone else wager a shot at this weird issue?
Regards,
Tekka.
 
Back
Top