Datagrid column template stack is calling main stack script.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Datagrid column template stack is calling main stack script.
When I click on the + button (next to column behavior) to create a template, revolution errors out because the datagrid row template stack is calling my preopenstack script on my main stack. And now everytime I click column behavior, nothing happens. I can not edit my column behavior script for the column that revolution gave me an error for. How do I get to my behavior script if it has errored out?
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Well, this is normal as the preOpenStack message travels from substacks to the mainstack if not trapped. Since this is the case for all substacks, you may want to 'protect' your preOpenStack in the mainstack script, like this
It is considered good form to pass the event along the message path, in case you want to use backscripts or other generic handlers along the message path.
HTH,
Jan Schenkel.
Code: Select all
on preOpenStack
if the target is not me then pass preOpenStack
-- otherwise do your normal stuff
...
-- finally pass so others can handle it
pass preOpenStack
end preOpenStack
HTH,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
I didnt have a problem with it before this random error. I had a preOpenStack script all day on my main stack but as soon as I made a 13th column and tried to create a template, the template stack decided to error out due to the preOpenStack script on my main stack. I went and added empty scripts to the template stack after that but the problem now is that the behavior button is now useless for the column that error-ed out on me. Ive already tried deleting and re-creating a new 13th column and that doesnt work. I REALLY do not want to have to delete my datagrid and re-make it. 

-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
I'm guessing here but if the error was in preopenstack then here is what I think happened:
When you tried to create the custom template for your column the Property Inspector opened the data grid substack because it was closed. The PI did this in order to create the custom template.
Your code in the preopenstack handler of your mainstack has an error in it because it isn't expecting a substack to generate the preopenstack message but rather the mainstack. When the error occurred it halted execution of the PI code that generates the custom template so no custom template exists.
If you weren't seeing the preopenstack earlier it could have been because you had the data grid template stack already open so the PI didn't have to open it, thus no preopenstack message was generated.
Like I said, just a guess. I would follow Jan's advice regarding the preopenstack since it is good defensive coding. If the above doesn't sound like the problem maybe you could upload your stack somewhere so I could take a look?
When you tried to create the custom template for your column the Property Inspector opened the data grid substack because it was closed. The PI did this in order to create the custom template.
Your code in the preopenstack handler of your mainstack has an error in it because it isn't expecting a substack to generate the preopenstack message but rather the mainstack. When the error occurred it halted execution of the PI code that generates the custom template so no custom template exists.
If you weren't seeing the preopenstack earlier it could have been because you had the data grid template stack already open so the PI didn't have to open it, thus no preopenstack message was generated.
Like I said, just a guess. I would follow Jan's advice regarding the preopenstack since it is good defensive coding. If the above doesn't sound like the problem maybe you could upload your stack somewhere so I could take a look?
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder