Hi there!
I have table (for example only)
ADD TABLE "combo1" AREA "Order" DUMP-NAME "combo1" ADD FIELD "exec_date" OF "combo1" AS date FORMAT "99/99/99" INITIAL ? POSITION 2 MAX-WIDTH 4 ORDER 10 ADD FIELD "result" OF "combo1" AS integer FORMAT "->,>>>,>>9" INITIAL "0" POSITION 5 MAX-WIDTH 4 VIEW-AS "VIEW-AS COMBO-BOX LIST-ITEM-PAIRS ""Performed"",-1,""Part. performed"",0,""Not performed"",1,""Uploded"",2. " ORDER 40
The table has only 3 records
27/04/15 0 27/04/16 -1 27/04/16 1 . PSC filename=combo1 records=0000000000003 ldbname=sports3000 timestamp=2016/04/28-11:33:33 numformat=44,46 dateformat=dmy-1950 map=NO-MAP
If run this simple code:
for each combo1. displ combo1. end.
The Сombo-box field display items labeles correctly:
But if do the same with browse + quiery I see only items integer value (not label):
DEFINE QUERY q1 FOR combo1 SCROLLING. DEFINE BROWSE b1 QUERY q1 NO-LOCK DISPLAY combo1.exec_date COLUMN-LABEL "Import!Data" combo1.result WITH SIZE 40 BY 10 SEPARATORS MULTIPLE. Define frame f1 b1. OPEN QUERY q1 FOR EACH combo1. ENABLE b1 WITH FRAME f1. APPLY "VALUE-CHANGED" TO BROWSE b1. WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.
What am I doing wrong with the last example (Browse and Query)?
Thanks!
It's currently scheduled to be fixed in 11.7. If the fix is simple enough we may be able to fix it in 11.6.3 but 11.6.2 is too close to release to add it there.
The browse doesn't pick up the VIEW-AS phrase from the field's dictionary definition. You have to explicitly add the VIEW-AS COMBO-BOX phrase to the column in the DISPLAY phrase of the DEFINE BROWSE statement.
Thank you Matt!
I added this, but no effect for "result" field.
In addition, I found that there is no effect only for integer. I added a new field with the character type (res2).
DEFINE QUERY q1 FOR combo1 SCROLLING. DEFINE BROWSE b1 QUERY q1 NO-LOCK DISPLAY combo1.exec_date COLUMN-LABEL "Import!Data" combo1.result VIEW-AS COMBO-BOX LIST-ITEM-PAIRS "Performed",-1,"Part. performed",0,"Not performed",1,"Uploded",2 combo1.res2 VIEW-AS COMBO-BOX LIST-ITEM-PAIRS "Performed",-1,"Part. performed",0,"Not performed",1,"Uploded",2 WITH SIZE 40 BY 10 SEPARATORS MULTIPLE. DEFINE FRAME f1 b1. OPEN QUERY q1 FOR EACH combo1. ENABLE b1 WITH FRAME f1. APPLY "VALUE-CHANGED" TO BROWSE b1. WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.
For character field that's work fine
Why it does not work for the integer field - this expected behavior? or a bug?
That looks like a bug. I'll take a look at it today to confirm that it's not working as expected.
It not work for decimal field also.
It's a bug. I have logged PSC00347147 for it.
Thank you Matt!
May be hoped that this will be fixed in the near future, for example, in 11.6.2, or may be in some hotfix?
It's currently scheduled to be fixed in 11.7. If the fix is simple enough we may be able to fix it in 11.6.3 but 11.6.2 is too close to release to add it there.
Ok, I understood.
Thank you!