Datagrid dgData bug

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Datagrid dgData bug

Bob Sneidar via use-livecode
Hi all.

Something is happening with getting the dgData of a datagrid. If I am stepping through code that gets the dgData of an empty datagrid, I get an array whose only key is 0 and there is no value. This never happened before. This is problematic for me because I often simply test to see if the variable is an array and proceed accordingly.

If anyone else can reproduce this, I will post a bug report. MacOS X 10.13.6 LC 9.0.1 rc1.

Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid dgData bug

Bob Sneidar via use-livecode
Hmmm... oddly this does not happen in a basic test stack. I am executing the commands in a behavior though, and that behavior is inline with the datagrid behavior. If that is the culprit, it's gonna be a beatch fixing it.

Bob S


> On Sep 12, 2018, at 08:08 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Hi all.
>
> Something is happening with getting the dgData of a datagrid. If I am stepping through code that gets the dgData of an empty datagrid, I get an array whose only key is 0 and there is no value. This never happened before. This is problematic for me because I often simply test to see if the variable is an array and proceed accordingly.
>
> If anyone else can reproduce this, I will post a bug report. MacOS X 10.13.6 LC 9.0.1 rc1.
>
> Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid dgData bug

Bob Sneidar via use-livecode
Okay I found a quick workaround. I check to see if the dgText of the datagrid is empty (which it is) before getting the dgData. This is very odd, and makes me nervous about chaining behaviors with datagrids.

Bob S


> On Sep 12, 2018, at 08:14 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Hmmm... oddly this does not happen in a basic test stack. I am executing the commands in a behavior though, and that behavior is inline with the datagrid behavior. If that is the culprit, it's gonna be a beatch fixing it.
>
> Bob S
>
>
>> On Sep 12, 2018, at 08:08 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>>
>> Hi all.
>>
>> Something is happening with getting the dgData of a datagrid. If I am stepping through code that gets the dgData of an empty datagrid, I get an array whose only key is 0 and there is no value. This never happened before. This is problematic for me because I often simply test to see if the variable is an array and proceed accordingly.
>>
>> If anyone else can reproduce this, I will post a bug report. MacOS X 10.13.6 LC 9.0.1 rc1.
>>
>> Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid dgData bug

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Bob Sneidar wrote:

 > Hmmm... oddly this does not happen in a basic test stack. I am
 > executing the commands in a behavior though, and that behavior
 > is inline with the datagrid behavior. If that is the culprit,
 > it's gonna be a beatch fixing it.

One of the things I learned from last month's discussion on chaining
behaviors with DataGrids is that a DG does not directly use the button
object assigned as its behavior; the actual script driving it is the
behavior of that assigned button.

IIRC the implications seem to be that if you do this:

  DataGrid -> CustomBehavior -> DGBehaviorButton -> DGBehaviorScript

...then references the actual DGBehaviorScript is making do not resolve
properly, and errors occur.

However, what works is assigning your behavior not to the DG directly,
but to the button it uses, setting your script's behavior to the
DGBehaviorScript:

  DataGrid  -> DGBehaviorButton -> CustomBehavior -> DGBehaviorScript

The downside to having to do this is that it prevents us from having
behaviors assigned to a specific subset of DataGrids.

At least that's as much as I recall.  And after skimming so many
messages it's likely I've missed something, so anyone with a more
complete understanding please chime in.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid dgData bug

Bob Sneidar via use-livecode
Hi Richard, thanks for that. As it is however, creating custom behaviors for subsets of grids is exactly what I need, so I can work around it well enough. It's a comfort to know that there can be resolution problems the way I am doing it, so that I don't stay awake at night going over and over it thinking it's something I have done.

Bob S


> On Sep 12, 2018, at 09:15 , Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Bob Sneidar wrote:
>
> > Hmmm... oddly this does not happen in a basic test stack. I am
> > executing the commands in a behavior though, and that behavior
> > is inline with the datagrid behavior. If that is the culprit,
> > it's gonna be a beatch fixing it.
>
> One of the things I learned from last month's discussion on chaining behaviors with DataGrids is that a DG does not directly use the button object assigned as its behavior; the actual script driving it is the behavior of that assigned button.
>
> IIRC the implications seem to be that if you do this:
>
> DataGrid -> CustomBehavior -> DGBehaviorButton -> DGBehaviorScript
>
> ...then references the actual DGBehaviorScript is making do not resolve properly, and errors occur.
>
> However, what works is assigning your behavior not to the DG directly, but to the button it uses, setting your script's behavior to the DGBehaviorScript:
>
> DataGrid  -> DGBehaviorButton -> CustomBehavior -> DGBehaviorScript
>
> The downside to having to do this is that it prevents us from having behaviors assigned to a specific subset of DataGrids.
>
> At least that's as much as I recall.  And after skimming so many messages it's likely I've missed something, so anyone with a more complete understanding please chime in.
>
> --
> Richard Gaskin


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid dgData bug

Bob Sneidar via use-livecode
There is a PR to fix this so that chaining doesn't break things.  I've
posted a demo of how to fix it in your current version:
https://github.com/bwmilby/lc-misc/tree/master/NestedDGBehavior


On Wed, Sep 12, 2018 at 11:19 AM Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Hi Richard, thanks for that. As it is however, creating custom behaviors
> for subsets of grids is exactly what I need, so I can work around it well
> enough. It's a comfort to know that there can be resolution problems the
> way I am doing it, so that I don't stay awake at night going over and over
> it thinking it's something I have done.
>
> Bob S
>
>
> > On Sep 12, 2018, at 09:15 , Richard Gaskin via use-livecode <
> [hidden email]> wrote:
> >
> > Bob Sneidar wrote:
> >
> > > Hmmm... oddly this does not happen in a basic test stack. I am
> > > executing the commands in a behavior though, and that behavior
> > > is inline with the datagrid behavior. If that is the culprit,
> > > it's gonna be a beatch fixing it.
> >
> > One of the things I learned from last month's discussion on chaining
> behaviors with DataGrids is that a DG does not directly use the button
> object assigned as its behavior; the actual script driving it is the
> behavior of that assigned button.
> >
> > IIRC the implications seem to be that if you do this:
> >
> > DataGrid -> CustomBehavior -> DGBehaviorButton -> DGBehaviorScript
> >
> > ...then references the actual DGBehaviorScript is making do not resolve
> properly, and errors occur.
> >
> > However, what works is assigning your behavior not to the DG directly,
> but to the button it uses, setting your script's behavior to the
> DGBehaviorScript:
> >
> > DataGrid  -> DGBehaviorButton -> CustomBehavior -> DGBehaviorScript
> >
> > The downside to having to do this is that it prevents us from having
> behaviors assigned to a specific subset of DataGrids.
> >
> > At least that's as much as I recall.  And after skimming so many
> messages it's likely I've missed something, so anyone with a more complete
> understanding please chime in.
> >
> > --
> > Richard Gaskin
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid dgData bug

Bob Sneidar via use-livecode
Sweet! Thanks Brian!

Bob S


> On Sep 12, 2018, at 09:52 , Brian Milby via use-livecode <[hidden email]> wrote:
>
> There is a PR to fix this so that chaining doesn't break things.  I've
> posted a demo of how to fix it in your current version:
> https://github.com/bwmilby/lc-misc/tree/master/NestedDGBehavior
>
>
> On Wed, Sep 12, 2018 at 11:19 AM Bob Sneidar via use-livecode <
> [hidden email]> wrote:
>
>> Hi Richard, thanks for that. As it is however, creating custom behaviors
>> for subsets of grids is exactly what I need, so I can work around it well
>> enough. It's a comfort to know that there can be resolution problems the
>> way I am doing it, so that I don't stay awake at night going over and over
>> it thinking it's something I have done.
>>
>> Bob S
>>
>>
>>> On Sep 12, 2018, at 09:15 , Richard Gaskin via use-livecode <
>> [hidden email]> wrote:
>>>
>>> Bob Sneidar wrote:
>>>
>>>> Hmmm... oddly this does not happen in a basic test stack. I am
>>>> executing the commands in a behavior though, and that behavior
>>>> is inline with the datagrid behavior. If that is the culprit,
>>>> it's gonna be a beatch fixing it.
>>>
>>> One of the things I learned from last month's discussion on chaining
>> behaviors with DataGrids is that a DG does not directly use the button
>> object assigned as its behavior; the actual script driving it is the
>> behavior of that assigned button.
>>>
>>> IIRC the implications seem to be that if you do this:
>>>
>>> DataGrid -> CustomBehavior -> DGBehaviorButton -> DGBehaviorScript
>>>
>>> ...then references the actual DGBehaviorScript is making do not resolve
>> properly, and errors occur.
>>>
>>> However, what works is assigning your behavior not to the DG directly,
>> but to the button it uses, setting your script's behavior to the
>> DGBehaviorScript:
>>>
>>> DataGrid  -> DGBehaviorButton -> CustomBehavior -> DGBehaviorScript
>>>
>>> The downside to having to do this is that it prevents us from having
>> behaviors assigned to a specific subset of DataGrids.
>>>
>>> At least that's as much as I recall.  And after skimming so many
>> messages it's likely I've missed something, so anyone with a more complete
>> understanding please chime in.
>>>
>>> --
>>> Richard Gaskin
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode