Restore Field Selections?

David Burgun dburgun at dsl.pipex.com
Sun Apr 9 15:32:40 EDT 2006


On 9 Apr 2006, at 19:19, Ken Ray wrote:

> On 4/9/06 12:57 PM, "David Burgun" <dburgun at dsl.pipex.com> wrote:
>
>> Hi,
>>
>> Do I need to restore the field selection after switching cards?
>>
>> I have a stack with two cards and in card 2 the user selects an item
>> in a list field and it gets selected ok, they then switch to card 1
>> and then back to card 2 but the current selection is lost when card 2
>> re-appears. Is this the correct action? If so what is the best place
>> to refresh the selection when switching cards?
>>
>> preOpenCard? openCard? or somewhere else?
>
> It depends on whether the rest of your card "resets" when you enter  
> it for a
> second time, or not. If it *does*, then don't worry about it, bt if it
> tries to keep data persistent, then store the hilitedLines in a custom
> property, and then restore them on preopencard.

No, it doesn't reset, it uses the same data each time it is opened. I  
put the code in the openCard handler, but you suggested the  
preOpenCard call, it works ok in openCard, but would it be better to  
put it in preOpenCard? I thought that a card might have to be  
displayed before the selection would appear. By selection I mean the  
mark that appears when you do:

set the hilitedLine of me to the cpSelected selected line of me

Thanks a lot
All the Best
Dave








More information about the use-livecode mailing list