Datagrid - strange behavior

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Simon Knight
Posts: 477
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Datagrid - strange behavior

Post by Simon Knight » Fri Apr 08, 2016 2:05 pm

Hi,

I have just started to use Livecode (7.1.3) after break and am refreshing my knowledge (ha!) on the working of Datagrids. I have created a simple stack that imports a list of names and addressed and I am displaying this list in two datagrids on the same card.

I have no specific problem of the “how do you do this” type but more a general observation. I have noticed that from time to time during editing a datagrid will just stop working. For example at present I am experimenting with a datagrid form and decided that I needed to edit the code in the LayoutControl as the default code referred to a field that had had its name changed. I commented out all the lines except

Code: Select all

set the rect of graphic "Background" of me to pControlRect
When I refreshed the datagrid it stopped displaying any data and worse un-commenting the lines made no difference. I suspect, but can not prove, that the engine had lost the connection to the behavior button and that the code was not being called. The display of the data was only restored by quitting Livecode and restarting.
This is not the first time that I believe I have seen what I have dubbed a silent failure when using datagrids and/or behavior buttons and wonder if anyone else has seen similar and has a work around.
best wishes
Skids

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Datagrid - strange behavior

Post by quailcreek » Fri Apr 08, 2016 11:27 pm

Hi,
I work with DGs all the time and I have not seen this.
Tom
MacBook Pro OS Mojave 10.14

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Datagrid - strange behavior

Post by Simon » Fri Apr 08, 2016 11:34 pm

I wonder if just testing this in liveCode 8 would be of help.
At least on Win 7 I get a debug.log file on my desktop, easy to look into to see what went wrong.
I'm not sure if the log file covers things like controls... but maybe?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon Knight
Posts: 477
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Datagrid - strange behavior

Post by Simon Knight » Sat Apr 09, 2016 12:13 am

Thanks for your comments. I have LC 8 DP16 and will look for a log file. Quailcreek your set up is the same as mine, when you say you use Dgs often are you customising them with additional controls and editing/adding behavior buttons?

I think that I shall have to investigate further but I am wondering if my machine either has a fault or if the multiple migrations from earlier OS and different hardware has retained some extension that causes problems.

best wishes

Simon
best wishes
Skids

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Datagrid - strange behavior

Post by quailcreek » Sat Apr 09, 2016 12:49 am

Simon,
Yes I have some heavily modified DGs. Setting the behavior btn on DG tables to an alternate btn so I can change the way it functions. DG forms too.
Tom
MacBook Pro OS Mojave 10.14

SparkOut
Posts: 2029
Joined: Sun Sep 23, 2007 4:58 pm

Re: Datagrid - strange behavior

Post by SparkOut » Sat Apr 09, 2016 9:08 am

Sometimes strange things happen if you have the row template open for editing while also making edits in the main stack structure that affects the datagrid. Make sure you save and close the row template before working on the datagrid itself.

Simon Knight
Posts: 477
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

Re: Datagrid - strange behavior

Post by Simon Knight » Sat Apr 09, 2016 4:00 pm

Hi again,

I have discovered a repeatable method of putting a datagrid into a state where modifying the code in the row behavior button fails to restore correct operation. In summary if the line exit to top is used things break. However, if the line is removed the datagrid remains broken until Livecode is restarted (on my machine).

I have managed to attach the stack file to this post and I have written some instructions which may be downloaded via this drop box link: https://dl.dropboxusercontent.com/u/419 ... Readme.zip

I would be interested in knowing if the failure I see happens on other machines.

Thanks in advance.

best wishes

Simon K.
Attachments
DataGridPlayStackBroken.livecode.zip
Archive with stack file
(17.98 KiB) Downloaded 63 times
best wishes
Skids

makeshyft
Posts: 187
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Datagrid - strange behavior

Post by makeshyft » Fri Feb 24, 2017 11:20 pm

Thank you for this, I've been with DGs for a long time and they work perfectly, except I am juts now getting really inconsistent behavior.
Thank you for the efforts of trying to trace the issues, it seems like the same stuff I'm dealing with.

Have you been able to resolve anything here?
Tom @
http://www.makeshyft.com
---------------------------------
Changing the Future, Today!

Ledigimate
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 132
Joined: Mon Jan 14, 2013 3:37 pm

Re: Datagrid - strange behavior

Post by Ledigimate » Sat Feb 25, 2017 9:26 am

Hi Simon

I've also dealt with custom datagrids that seemed to break for no apparent reason, and eventually found that in my case it was caused by one really important line of code which was missing from my saveStackRequest handler.
If you handle the saveStackRequest message in a stack with a datagrid, then be sure to pass on the saveStackRequest message. Not doing so is guaranteed to break your datagrid!

Code: Select all

on saveStackRequest
   -- do stack cleanup here
   
   -- Do NOT omit the next line of code from a stack with a datagrid:
   pass saveStackRequest
end saveStackRequest
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101

Post Reply

Return to “Talking LiveCode”