Hide field on preopenstack

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ali yehia
Posts: 16
Joined: Tue Aug 04, 2015 9:43 am

Hide field on preopenstack

Post by ali yehia » Tue Aug 11, 2015 11:50 am

I made stack and card inside it. the card has many fields. I need hide some fields and show it in certain event.

I write code

preOpenStack

hide field "t98"

end preOpenStack


But still t98 appears

What do I do?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Hide field on preopenstack

Post by richmond62 » Tue Aug 11, 2015 12:31 pm

Um . . .

try this in the card script:

on preOpenCard
hide fld "t98"
end preOpenCard

it works!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Hide field on preopenstack

Post by dunbarx » Tue Aug 11, 2015 4:15 pm

Hi.

What Richmond said, and the reason is that the preOpenStack message fires before the card loads. So it is more prudent to put your handler in a place where it is comfortable.

Craig Newman

ali yehia
Posts: 16
Joined: Tue Aug 04, 2015 9:43 am

Re: Hide field on preopenstack

Post by ali yehia » Tue Aug 11, 2015 6:42 pm

Thanks all

It is working

Klaus
Posts: 14190
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Hide field on preopenstack

Post by Klaus » Thu Aug 13, 2015 11:05 am

Hi Ali,

you forgot the highly important ON in your first script:

Code: Select all

preOpenStack
   hide field "t98" 
end preOpenStack
This way, the "preopenstack" message does NOT get triggered at all!

Code: Select all

ON preOpenStack
   hide field "t98" 
end preOpenStack
Best

Klaus

Post Reply