Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox's drop down list problem.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00773314
Message ID:
00773770
Vues:
10
>>>>>I have a combobox who's dropdown list shows up as empty when it shouldn't.
>>>>>In the DropDown() method I have something like this:
>>>>>
>>>>>lnQResult = REQUERY(viewname)
>>>>>
>>>>>IF lnQResult <> 1
>>>>> Wait Window ('Requery problem')
>>>>>ELSE
>>>>> This.Requery()
>>>>> wait window ('Made it this far')
>>>>> This.Refresh()
>>>>> If This.ListCount = 0
>>>>> Wait Window ('empty list')
>>>>> EndIF
>>>>>EndIf
>>>>>
>>>>>I get the problem with this sequence of actions:
>>>>>
>>>>>1. Users clicks the down arrow - the view has a bunch of records, the user selects one.
>>>>>2. User takes focus off the combobox, then goes back to the combobox and clicks the down arrow.
>>>>>3. This time, there is only 1 record in the view, so that is what they select.
>>>>>4. User takes focus off the combobox, then goes back to the combobox and clicks the down arrow.
>>>>>5. This time the view has a bunch of records, but the list shows up empty! Plus the listcount is NOT equal to zero!!
>>>>>6. If they click the down arrow a second time, it works.
>>>>>
>>>>>I can repeat this 100% of the time. Does ANYONE have ANY idea on a work around for this? I've tried it with VFP7 and 8...same problem.
>>>>>
>>>>>Thanks!
>>>>
>>>>Victor,
>>>>
>>>>I have seen this type of behaviour with the combobox, listbox and grid when it related to a cursor / table. The cause, I believe, is the record pointer the control believes it should be on, no longer exist and it appears blank. I have set the pointer to the first record, refreshed the control, requeried, then refreshed the control again to get this behaviour to stop.
>>>>
>>>>HTH,
>>>
>>>hmmmmm...well I tried that and still seem to have the same behavoir, I still have to hit the down arrow 2 times. Maybe I can put the code that's in the downarrow in a new method and just run it two times??
>>>I've had problems like this in the past and actualy ended up putting a textbox on top of the combobox to get it to do what I wanted. It just seems insane to do something like that though.
>>
>>I'm sure I had to refresh the object more than once for the information to correctly appear. I was just having the problem yesterday with a grid, after deleting a record in it. I rebuilt the cursor, and the grid was blank. Added Go Top in Cursor, Grid.Refresh() cured the problem. I have seen the behaviour before in comboboxes, and cleaned it up the same way then. Wish I could have been more help.
>
>
>Well I'm closer to getting it to work. Since the problem only happens when the prior dropdown resulted in just one record I did something like this:
>
>lnQResult = REQUERY(viewname)
>
>IF lnQResult <> 1
> Wait Window ('Requery problem')
>ELSE
> IF RECCOUNT(viewname) = 1
> This.Value = &viewname..field_key
> This.Valid()
> lcParameter = 'Something that will return zero results'
> lnQResult = REQUERY(viewname)
> EndIF
> This.Requery()
> wait window ('Made it this far')
> This.Refresh()
>EndIf
>
>
>oooook. So now my problem is with the line that says "This.Value = &viewname..field_key". Now I get a "record out of range" error! Thinking that maybe it was the view, I put in
>This.Value = 'Example'
>and still got the same error - so the "record out of range" error is from the combobox! Anyone got any ideas/workarounds for THIS problem now? geeeeze what a pain in the neck!

I found a way to do it without needed to change the this.value - so I guess I FINALLY got it working.
ICQ 10556 (ya), 254117
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform