Page 1 of 1
Datagrid column template stack is calling main stack script.
Posted: Wed Aug 05, 2009 7:42 pm
by Paul D
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?
Posted: Wed Aug 05, 2009 8:28 pm
by Janschenkel
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
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
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.
Posted: Wed Aug 05, 2009 9:25 pm
by Paul D
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.

Posted: Wed Aug 05, 2009 11:14 pm
by trevordevore
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?
Posted: Thu Aug 06, 2009 1:20 pm
by Paul D
Sounds about right. I went in the row template stack and found the hidden behavior buttons to open the script for the column I need. Thanks for the advice.