DataGrid Error: Trying to Load a Grid on Program Start

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

DataGrid Error: Trying to Load a Grid on Program Start

Andrew Kluthe
Hey all,

I have two datagrids that save the data within them to the disk when it is changed and reloads from the file on program start.

The files they save are tab delimited lines with the headers in line one. This the output of the grid's dgText. On load, if the files are empty except for headers it sets the dgData to of this grid to empty.

The calls to load the files from disk appears in the Stack Script and the grids themselves are on a card called "LocalData".

I get the following errors whether I set the data to empty or set it to the data that is on the disk.

Type: Object: can't set object property
Object: group "AddTickets" of card "LocalData" of stack "C:/FarmOffice/GrainCart/GrainCart.rev"
Line: set the dgData of me to empty
Line Num: 0
Hint: -8


AND

354,0,0,-8
90,4128,20
449,4128,5,-8
535,4128,1,-8
241,4128,1,_table.CreateDefaultHeaderGroup
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,4049,1
253,4048,1
253,4047,1
490,4045,1
241,4045,1,_table.CreateHeaders
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,3951,1
241,3951,1,_table.CreateColumns
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,151,1
253,150,1
253,113,1
241,113,1,_Initialize
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,4512,18
253,4512,1
241,4512,1,dgData
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
90,3205,36
449,3205,5
535,3205,1
241,3205,1,_table.SetText
353,0,0,button id 1005 of group id 1004 of card id 1002 of stack "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
573,4442,1
587,4440,1


I have tried two different methods for clearing the data to see if it was how I was doing it that was causing the errors instead of what I was doing:

1. I tried using

set the dgData of group "AddTickets" of card "LocalData" to empty

This failed.

2. I tried putting a command inside of the datagrid that has this code in it.

on ClearData
set the dgData of me to empty
end ClearData

The code I used to call the handler inside the grid was:
send "ClearData" to group "AddTickets" of card "LocalData"

I even tried sending the above command in 3 seconds to see if it was that I had not properly initialized something when it was executed.


The bizarre thing is that I have a third datagrid that holds the last Live records in the database and setting it up in all of the above ways mentioned works perfectly.

Whats the deal?? I have been pulling my hair out.
Reply | Threaded
Open this post in threaded view
|

Re: DataGrid Error: Trying to Load a Grid on Program Start

Andrew Kluthe
Another set of attempts were all failures.

This time I put the code to load the file into the DataGrid inside of the datagrid.

I recieved the same errors when trying to call that handler from the stack or any other card script.

So I made a set of buttons on card "LocalData" to send the data load message to the grids. This works fine.

I tried to send a mouseup to these buttons from the stack and card scripts. This returns the same error.

I don't get it. Why does this work in a button and not a stack or card script?
Reply | Threaded
Open this post in threaded view
|

Re: DataGrid Error: Trying to Load a Grid on Program Start

zryip theSlug
In reply to this post by Andrew Kluthe
On Thu, Aug 26, 2010 at 9:10 PM, Andrew Kluthe <[hidden email]> wrote:

>
> Hey all,
>
> I have two datagrids that save the data within them to the disk when it is
> changed and reloads from the file on program start.
>
> The files they save are tab delimited lines with the headers in line one.
> This the output of the grid's dgText. On load, if the files are empty except
> for headers it sets the dgData to of this grid to empty.
>
> The calls to load the files from disk appears in the Stack Script and the
> grids themselves are on a card called "LocalData".
>
> I get the following errors whether I set the data to empty or set it to the
> data that is on the disk.
>
> Type: Object: can't set object property
> Object: group "AddTickets" of card "LocalData" of stack
> "C:/FarmOffice/GrainCart/GrainCart.rev"
> Line: set the dgData of me to empty
> Line Num: 0
> Hint: -8
>
>
> AND
>
> 354,0,0,-8
> 90,4128,20
> 449,4128,5,-8
> 535,4128,1,-8
> 241,4128,1,_table.CreateDefaultHeaderGroup
> 353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
> "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
> 573,4049,1
> 253,4048,1
> 253,4047,1
> 490,4045,1
> 241,4045,1,_table.CreateHeaders
> 353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
> "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
> 573,3951,1
> 241,3951,1,_table.CreateColumns
> 353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
> "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
> 573,151,1
> 253,150,1
> 253,113,1
> 241,113,1,_Initialize
> 353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
> "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
> 573,4512,18
> 253,4512,1
> 241,4512,1,dgData
> 353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
> "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
> 90,3205,36
> 449,3205,5
> 535,3205,1
> 241,3205,1,_table.SetText
> 353,0,0,button id 1005 of group id 1004 of card id 1002 of stack
> "C:/FarmOffice/GrainCart/Externals/revdatagridlibrary.rev"
> 573,4442,1
> 587,4440,1
>
>
> I have tried two different methods for clearing the data to see if it was
> how I was doing it that was causing the errors instead of what I was doing:
>
> 1. I tried using
>
> set the dgData of group "AddTickets" of card "LocalData" to empty
>
> This failed.
>
> 2. I tried putting a command inside of the datagrid that has this code in
> it.
>
> on ClearData
> set the dgData of me to empty
> end ClearData
>
> The code I used to call the handler inside the grid was:
> send "ClearData" to group "AddTickets" of card "LocalData"
>
> I even tried sending the above command in 3 seconds to see if it was that I
> had not properly initialized something when it was executed.
>
>
> The bizarre thing is that I have a third datagrid that holds the last Live
> records in the database and setting it up in all of the above ways mentioned
> works perfectly.
>
> Whats the deal?? I have been pulling my hair out.
>
> --


Hi Andrew,

If I understand well you try to set the content of a datagrid to a
value, and this datagrid is not in a card you load by going in it?
A datagrid is loaded only if you go physically in its card. It's
because the datagrid object is fully initialize when it can execute
its preopencontrol event.

The trick here is to go to the card "LocalData" at startup to preload
the datagrid "AddTickets" then you can set it to empty or to the value
you need.

Example:

on preOpenStack
go to cd "LocalData" -- load the datagrid in this card
go to first cd
set the dgData of grp "AddTickets" to empty
end preOpenStack

Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DataGrid Error: Trying to Load a Grid on Program Start

zryip theSlug
On Thu, Aug 26, 2010 at 11:53 PM, zryip theSlug <[hidden email]> wrote:

> on preOpenStack
> go to cd "LocalData" -- load the datagrid in this card
> go to first cd
> set the dgData of grp "AddTickets" to empty
> end preOpenStack

I correct myself:

on preOpenStack
go to cd "LocalData" -- load the datagrid in this card
go to first cd
set the dgData of grp "AddTickets" of cd "LocalData" to empty
end preOpenStack

--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: DataGrid Error: Trying to Load a Grid on Program Start

Andrew Kluthe
Zryip! You are a life saver! This makes perfect sense. It was working fine when I was watching the data come in and out by opening the card with the grids on it. Right before my meeting I hid that button because the end user doesn't need to see all of that. Then the program suddenly didn't work anymore about 15 minutes from my meeting!

I will show my sincere gratitude by combing finely through your latest incarnation of DGH this weekend! I have been using it alot this week!

thank you thank you thank you


Andrew
Reply | Threaded
Open this post in threaded view
|

Re: DataGrid Error: Trying to Load a Grid on Program Start

zryip theSlug
On Fri, Aug 27, 2010 at 6:49 AM, Andrew Kluthe <[hidden email]> wrote:
>
> Zryip! You are a life saver! This makes perfect sense. It was working fine
> when I was watching the data come in and out by opening the card with the
> grids on it. Right before my meeting I hid that button because the end user
> doesn't need to see all of that. Then the program suddenly didn't work
> anymore about 15 minutes from my meeting!

Months ago, I fought hours with that before I understand what happens
and how to fix it.
In DGH, I'm using dictionaries grids in hidden cards or stacks. One
for the properties list and one for the script builder.

> I will show my sincere gratitude by combing finely through your latest
> incarnation of DGH this weekend! I have been using it alot this week!

Great! I'm glad you found a way to the DGH beta version in your current work.
I'm actually working to a new version. I will send you a mail soon.
Thanks.

> thank you thank you thank you

You're welcome * 3 ;)


Regards,
--
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution