DCCOMBOBOX ... REFRESH

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

DCCOMBOBOX ... REFRESH

#1 Post by Tom »

Hi, Roger.

If a DCCOMBOBOX/DROPDOWNLIST has a REFRESH clause, something strange is happening if the items for the listbox are somehow similar. As you can see in this sample, the items are "Tom 2", "Tom 21" and "Tom". With REFRESH on, it's almost impossible to briefly select "Tom" - the listbox shows "Tom 2" anyway, but "Tom" IS selected (look at the DCSAY). I was wondering if this has something to do with SET EXACT (see button), but this seems to be not true. I already looked through functions used like DC_VarFromListBox() and DC_GetDatalink, but I didn't find any code comparing portions.

Code: Select all

FUNCTION Main()
LOCAL GetList := {}, oDialog, aTest := {'Tom 2', 'Tom 21', 'Tom'}, cTest := aTest[1], lExact := .F.

@ 1,1 DCCOMBOBOX cTest LIST aTest SIZE 25,15 TYPE XBPCOMBO_DROPDOWNLIST REFRESH /* ITEMSELECTED {||DC_GetRefresh(GetList)} */

@ 3,1 DCSAY {||cTest} SIZE 10,1

@ 4,1 DCSAY {||'EXACT is '+IF(Set(_SET_EXACT),'on','off')} SIZE 10,1

@ 6,1 DCPUSHBUTTON CAPTION {||IF(lExact,'Exact off','Exact on')} SIZE 12,1 ;
      ACTION {||lExact := !lExact,Set(_SET_EXACT,lExact),DC_GetRefresh(GetList)}

DCREAD GUI ADDBUTTONS TITLE 'Test' FIT PARENT @oDialog

RETURN nil

PROC AppSys() ; RETURN
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCCOMBOBOX ... REFRESH

#2 Post by rdonnay »

Tom -

I cannot reproduce the behavior you described.

Roger
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCCOMBOBOX ... REFRESH

#3 Post by Tom »

Hi, Roger.

Strange. If I select "Tom" in the combobox, it jumps back to "Tom 2", although "Tom" is selected, as the SLE below shows:
Attachments
combo.jpg
combo.jpg (13.35 KiB) Viewed 8151 times
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: DCCOMBOBOX ... REFRESH

#4 Post by Wolfgang Ciriack »

Hi Tom,
i can confirm this. If you change the array to

Code: Select all

aTest := {'Tom 2 ', 'Tom 21', 'Tom  '}
that all items have the same lenght, than it works.
_______________________
Best Regards
Wolfgang

User avatar
Tom
Posts: 1172
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DCCOMBOBOX ... REFRESH

#5 Post by Tom »

Hi, Wolfgang.

Thanks for the workaround. :) The strange thing is, this happens only with the REFRESH clause.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCCOMBOBOX ... REFRESH

#6 Post by rdonnay »

I will look more into this.
The eXpress train is coming - and it has more cars.

Post Reply