Page 1 of 1

Data grid not working in standalone

Posted: Wed Feb 27, 2013 6:08 pm
by japino
I have a datagrid in a substack of a launcher stack which works fine in LiveCode but not as a standalone. With not working I mean that I cannot edit any values or read in new values using a button. All this works in LiveCode.

What I've tried is this:
Added a datagrid to my mainstack (the launcher stack) and left it empty and hid it.
I've selected "Select inclusions for the standalone application"

In "Stacks in the selected stack file" I see:
Launcher (in bold)
Preferences
MainApplication
Data Grid Templates with a bunch of numbers
Data Grid Templates Dud

Before I start to redo my stacks starting with a brand-new main stack and adding the other stacks again from scratch to see if that fixes the issue, does anyone have any clue as to why this would not work? Thanks!!

Re: Data grid not working in standalone

Posted: Wed Feb 27, 2013 9:48 pm
by dunbarx
I am no expert, but the "dud" is the key, and you have it in the right place. You should not need a DG in the executable.

If you make a new launcher and a new stack (included in "Stack files in the Application"), that is, not a substack, just another stack that is explicitly included that contains that DG, and have only the launcher and the dud in the "Stacks in the selected stack file", does the new standalone work?

Craig Newman

Re: Data grid not working in standalone

Posted: Thu Feb 28, 2013 11:55 am
by japino
Thanks Craig. I have really no idea what was wrong with my original stack, but I started from scratch:
- Created Mainstack which is just a Launcher.
- Created a substack which contains the main UI including the datagrid.
- Created a substack called "Data Grid Templates Dud"
- Used the default options in Standalone Settings
- Built the standalone, and now it just works!

Re: Data grid not working in standalone

Posted: Thu Feb 28, 2013 1:51 pm
by Klaus
Hi Japino,

well, sometimes there ARE in fact gremlins in Livecode :D

I always do what you have done, add an empty datagrid to my mainstack and hide it.
This will have the same effect as the "Data Grid Template Dud":
It will create a substack "Data Grid Template xxxx" and that is what the standalone builder checks!
If theres is a substack starting with "Data Grid Templates ..." then the datagrid library will be added to the standalone.


Best

Klaus

Re: Data grid not working in standalone

Posted: Thu Feb 28, 2013 2:10 pm
by japino
So, this has to do with "Move substacks into individual stackfiles", which was checked in Standalone Settings. When this option is unchecked, the data grid behaves correctly. May be this is also what Craig hinted at. Anyway, that's clear now.

But... I want my data grid to retain the values between sessions. I'm using the splash stack method, and I have "save this stack" in the "close stack" handler of the stack with the data grid. For the splash stack method to work (to retain any changed values), I need to have "Move substacks into individual stackfiles" checked, right?

Hmmm, seems like I can't have both... Is it possible to use the splash stack method, and still have a functioning data grid which retains changed values between sessions?

Re: Data grid not working in standalone

Posted: Thu Feb 28, 2013 2:24 pm
by Klaus
Hi japino,

ah, yes, in that case you cannot have both, which is definitiely a "flaw" in Livecode,
since unfortunately one cannot check "data grid library" manually in the inclusions.

So you will need to save the data in the datagrid on the users hd when the stack closes
and read it in again when the app starts the next time!

And please do not forget that a user of your app does not have admin permissions
and thus cannot write (save stacks!) in the application folder (if the app will be installed there)!


Best

Klaus

Re: Data grid not working in standalone

Posted: Thu Feb 28, 2013 3:02 pm
by japino
Thanks Klaus for the confirmation!

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 4:29 pm
by n9yty
Hi,

I'm not trying to hijack a thread, but since I was just going to ask about this problem and the thread isn't too old I thought maybe it would be appropriate to add to it.

I have very simple stack, just two cards. I also have a asub-stack with two cards on it which I reference but they aren't part of the main flow. The main card has a data grid on it. In the hierarchy of the stack I see a "Data grid Templates xxxxxxx" stack and my Resources stack.

Inside LiveCode everything works great. I can deploy to the android emulator and a real android device and all is good. I can deploy to the iOS simulator and all is good. I haven't set up the dev stuff on my iPad to actually test on hardware yet.

When I deploy to a Mac or Windows app, I get the opening stack window with the empty data grid showing, and I can resize it and such but it never populates with the content, which it pulls from a web site, but neither does it give me a timeout error I have programmed in so it is almost like something in the stack has died. The only "mobile" thing I am doing is setting a mobile scroller, but all of those calls are entirely within 'if the environment is "mobile"' so they shouldn't ever be called on the desktop app to crash it (if they even would).

I looked inside the Mac app package contents and I don't see a data grid library file included, should there be one, or is it built into the main executable? I see the XML library. I also see the XML library in the Windows "Externals" folder but nothing for the data grid.

How do you debug this kind of problem?

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 4:40 pm
by Klaus
Hi n9yty,

the DataGrid lib is a SCRIPT library and no external like XML etc.,
and yes it will be made part of your mainstack/standelone.

Short question (I know since I have bitten by this in the past :) :
Did you add a password to your stack(s) in the standalone builder?


Best

Klaus

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 4:45 pm
by n9yty
Klaus wrote:Hi n9yty,
the DataGrid lib is a SCRIPT library and no external like XML etc.,
and yes it will be made part of your mainstack/standelone.

Short question (I know since I have bitten by this in the past :) :
Did you add a password to your stack(s) in the standalone builder?
No, no password. I am using the Trial version of LiveCode, very new to the environment. I started this project by pulling stuff from the web, testing the XML routines and such and putting the contents into a field, and that all worked fine across all environments, even with the mobile scrollers in place.

I ripped out the text field and replaced it with a datagrid, tested on Android/iOS and everything is working fine, but when I tried to build for Mac/Windows I am running into this problem. I am just assuming it is related to data grids because that is all that I changed from how things were working before.

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 5:03 pm
by Klaus
Hm, no idea so far...

Definitively SHOULD work on desktop when it works on mobile!

Add some ANSWER "done loading data from db" etc... to see where it stops working,
maybe that will give you a hint where to look for.


Best

Klaus

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 5:12 pm
by n9yty
Klaus wrote:Hm, no idea so far...
Definitively SHOULD work on desktop when it works on mobile!

Add some ANSWER "done loading data from db" etc... to see where it stops working,
maybe that will give you a hint where to look for.
Klaus, thank you, I was just doing this. It loads a page from the web and seems to be hanging when it creates the XML Tree:

Code: Select all

put URL myURL into tPage
put revCreateXMLTree ( tPage, false, true, false ) into tTree
It never gets past the revCreateXMLTree call, it seems to be hanging or dying there. Well, clearly NOT data grid related, so I will open a new thread if I cannot figure this out myself. :) The funny thing is that I certainly haven't changed ANY of that code from when it was working before, and it does work on iOS/Android, so I am puzzled, but that is how we learn best. :)

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 5:24 pm
by Klaus
OK, but you should do more error checking! 8)

Code: Select all

...
put URL myURL into tPage
if the result <> EMPTY then
  answer "Oops, URL problem:" && the result
end if
put revCreateXMLTree ( tPage, false, true, false ) into tTree
...
Best

Klaus

Re: Data grid not working in standalone

Posted: Fri Mar 08, 2013 5:43 pm
by n9yty
Klaus wrote:OK, but you should do more error checking! 8)
I am going to, I wanted the skeleton to work before I put nice clothes on it. Especially since this is a trial of LiveCode I wanted to invest my time in seeing if the logic would be workable not so much about a bullet proof deployable app at this point. I had just been testing that very thing to see why the XMLCreate was failing, and in fact it is not getting anything from the "put URL". Why does that work from inside LiveCode, the iOS/Android simulators, and my Android handset but yet it does not work on standalone Mac or Windows, on at least two different Mac and two different Windows computers? Now that is a puzzle... And it used to.

The one possible difference is that when I built my earlier desktop versions I may have had LiveCode 5.5.3. I since put 5.5.4 on because I already had XCode 4.6 installed for other work and 5.5.3 did not find the iOS libraries. Is it something in 5.5.4 that is broken? Seems I wouldn't be the only one to see this if that were the case.

And I agree... Long live error checking! LoL

Re: Data grid not working in standalone

Posted: Sat Mar 09, 2013 7:28 pm
by jacque
The mobile and desktop standalones use slightly different resources. Your desktop builds aren't finding the libraries it needs. Double-check that both XML and Internet are selected in the standalone settings. Those library choices aren't used the same way when building for mobile, but are required for desktop builds.

I know you said it worked before, but maybe those libraries became unselected. There is also the loading sequence, where the libraries aren't available for use until after the startup sequence is finished.