PDA

View Full Version : dbList not multiselecting correctly after deselecting



Peter Brooks
22-Feb-2005, 11:18 PM
Tested in both vdf7 and vdf10.1
I am using a dblist
The dbList loads ok If I check any combination of rows then they are
selected ok. I test this by adding up some values from each row. However,
the problem is once the selection is made and it is unchecked the next time
you make a selection (from any row) that row is the only recognised
selection, even though the dbList may have 10 other selected rows. They
still remain highlighted.
I have stripped my dblist to bare bones - it started off with a selectable
checkbox.

The code that adds up the selections is:
Procedure DoAddUpAmounts
Number nAmount
Integer iRecNum

Get First_Selected_Item To iRecnum
Repeat
Move (Next_Selected_Item (Self, 1)) To iRecNum
showln "Recnum: " iRecnum
If (iRecNum > 0) Begin
Clear Activity
Move iRecnum to Activity.Recnum
Find eq Activity by recnum
If (Found) Add Activity.Fee1 to nAmount
If (Found) showln "Found: " iRecnum "fee: " activity.fee1 " Amount: "
nAmount
Else showln "Not found: " iRecnum
End

Until (iRecNum < 1)
Set Value of (Enrol_Amounts(Self)) item 0 to nAmount
End_Procedure

This may be a bug in dataflex. Has anyone got a multi-select dblist that
adds stuff up? Does it really work?

Peter Brooks

Peter Brooks
23-Feb-2005, 12:26 AM
Some more information.
I am beginning to suspect that the code "Move (Next_Selected_Item (Self,
1)) To iRecNum" may be causing the row to be deselected. I found a reference
to a "clear_selection" setting that can toggle this fate. The help is not
clear on how this works. I'll keep looking.

Ian Telfer
23-Feb-2005, 12:57 AM
Peter,

Have you tried using Vincent's Checkbox select list? That works very well.
Just a thought.

Ian

Peter Brooks wrote:
> Tested in both vdf7 and vdf10.1
> I am using a dblist
> The dbList loads ok If I check any combination of rows then they are
> selected ok. I test this by adding up some values from each row. However,
> the problem is once the selection is made and it is unchecked the next time
> you make a selection (from any row) that row is the only recognised
> selection, even though the dbList may have 10 other selected rows. They
> still remain highlighted.
> I have stripped my dblist to bare bones - it started off with a selectable
> checkbox.
>
> The code that adds up the selections is:
> Procedure DoAddUpAmounts
> Number nAmount
> Integer iRecNum
>
> Get First_Selected_Item To iRecnum
> Repeat
> Move (Next_Selected_Item (Self, 1)) To iRecNum
> showln "Recnum: " iRecnum
> If (iRecNum > 0) Begin
> Clear Activity
> Move iRecnum to Activity.Recnum
> Find eq Activity by recnum
> If (Found) Add Activity.Fee1 to nAmount
> If (Found) showln "Found: " iRecnum "fee: " activity.fee1 " Amount: "
> nAmount
> Else showln "Not found: " iRecnum
> End
>
> Until (iRecNum < 1)
> Set Value of (Enrol_Amounts(Self)) item 0 to nAmount
> End_Procedure
>
> This may be a bug in dataflex. Has anyone got a multi-select dblist that
> adds stuff up? Does it really work?
>
> Peter Brooks
>
>

Peter Brooks
23-Feb-2005, 06:51 PM
I have that select list. It is not for a dbList.

Thanks for the thought.

Still perplexed about this:
In the Help under 'next_selected_item' you get this:

If clear_selection is true, the item's select_state is reset false;
otherwise, it is left unchanged.

I cannot find any more information on this 'clear_selection' or how to use
it.