LayoutControl Handler Won't Run

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
Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

LayoutControl Handler Won't Run

Post by Gage » Thu May 30, 2013 5:41 pm

Hello,

I am working on a DataGrid Form, and for some reason, when I set the dgData, the FillInData handler runs only once, and the LayoutControl handler does not run at all.

No errors are thrown, and I have proofed the code many times. Since everything with DG's happens behind the scenes, I'm not really sure where it's going wrong. Anyone know of any reason that the LayouControl handler would refuse to run?

I can include code, but was hoping there may be a general reason or way I could troubleshoot it somehow.

Thanks,
Phil E.

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: LayoutControl Handler Won't Run

Post by Gage » Thu May 30, 2013 6:40 pm

On further testing, I have found that if I comment out a switch statement I had been using in the FillInData handler, the DataGrid lays itself out correctly. After un-commenting the switch statement, it stops again.

The switch code itself appears to be OK, but is there some reason that executing a switch in the FillInData handler would cause the code to stop executing?

Here is the switch statement of interest. It takes the header value, which is populated from pDataArray, and sets the visibility of a group in the row template based on it.

switch tTitle
case "Name"
case "Phone Number"
case "Email Address"
case "Fish/Personality Type"
case "Sort List"
set the vis of grp "Expand Field" of me to true
set the text of btn "Expand Button" of me to "+"
break
default
set the vis of grp "Expand Field" of me to false
end switch


Insight much appreciated!
Phil E.

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: LayoutControl Handler Won't Run

Post by Gage » Thu May 30, 2013 7:24 pm

Please disregard. I was setting the text to a button that no longer exists.

Silly mistake. The lesson: debug better before posting on the forums. Have a nice day.

Phil E.

Post Reply