DataGrid Inquiry

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

DataGrid Inquiry

Post by gpearson » Sun Apr 13, 2014 8:27 pm

I am working with the Data Grid and trying to understand why when the application has been created as a standalone the datagrid does not work. When the application is ran in development mode, and I click on a record in the datagrid the answer will display the row of the record.

Now when I compile the application to run in standalone and click on the row of the datagrid, the answer box will display a blank window.


In the script I have the following

Code: Select all

answer the dgHilitedLines of me with "OK" titled "User Selected Row"
Anyone who has compiled an application with datagrid, can you shed some light on this. It has me puzzled.
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: DataGrid Inquiry

Post by keram » Mon Apr 14, 2014 1:39 am

Hi Graham,

It should work. I extracted that part of my app as an example - the code is in the Template Row.

keram
Attachments
sample.zip
(52.43 KiB) Downloaded 233 times
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Re: DataGrid Inquiry

Post by gpearson » Wed Apr 16, 2014 6:39 pm

Thanks for the reply and sorry it took awhile as I just finished up with Tax Day here in the States.

When I posted the inquiry, I had the code on the group of the DataGrid with the mouseDown section and noticed that when I created the standalone the code within the mouseDown did not work so I started to debug. In the attached sample zip file when I compiled the application and ran it, It did work which makes me believe that I might have had my code in the wrong spot.

When I moved the answer code into the Row Template Group, I get the same result which is a blank window and the title Box in Row Group Behavior on News Headline Field

Code: Select all

answer the dgHilitedLines of me with "OK" titled "Box in Row Group Behavior on News Headline Field"
I just found out that I was putting the script on the Row Template. When I put code on the Row Behavior and create the standalone, I get the same result.


More background, This application I compile as a standalone is a splash screen that downloads another stack that has an extension of .dat if the file is not in the directory. When I make a change I copy the .dat file into the directory as my development directory is connected to the repository I use for change management. After I copy the .dat file into the ProgramData directory and run the standalone, I get the new title which shows me it is the correct version of the application but the message part of the box is blank.

If I replace the dgHilitedLines of me with "This is a test" I get this is a test within the answer box. Boy this has me puzzled.
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Re: DataGrid Inquiry

Post by gpearson » Thu Apr 17, 2014 3:28 pm

Well after working on this for the past 2 days, I am about to give up. At this point, I have deleted the DataGrid from the card and also removed the associated card within the Data Grid Templates stack.

I have added a new DataGrid to the card of the stack and named it the same name as before so all of my code will work when populating the DataGrid. I have the DataGrid style as Table. During this time, I added all of my code to the Group DataGrid which is

Code: Select all

global gLatestNewsArray, gSelectedNewsHeadline, gSelectedNewsArticleText, gSelectedNewsDate

local theSelectedLine

on mouseUp pBtn
if pBtn is 1 then
put the dgHilitedLines of me into theSelectedLine
put gLatestNewsArray[theSelectedLine]["Headline"] into gSelectedNewsHeadline
put gLatestNewsArray[theSelectedLine]["ArticleText"] into gSelectedNewsArticleText
put gLatestNewsArray[theSelectedLine]["NewsDate"] into gSelectedNewsDate
go to card "News Article Card" on stack "PopupWindows"
show stack "PopupWindows"
end if
end mouseUp
On the script of the stack "PopupWindow" I have all of the global variables I use in the application defined along with

Code: Select all

on openStack
set the loc of me to gScreenCenterLoc
end openStack

on clodeStack
close stack "PopupWindows"
end closeStack
Then on the News Article Card Script I have the global variables from the application that is defined plus

Code: Select all

on openCard
put gSelectedNewsHeadline into fld "News Headline Field" on me
put gSelectedNewsArticleText into fld "Article Contents Field" on me
put gSelectedNewsDate into fld "Article Date Field" on me
end openCard
When I run this in development, I get the record of the gLatestNewsArray on the News Article Card in the proper locations but when I run the Standlone Splash screen that loads up this stack, I get nothing in the data field areas. When I put answer commands in various locations in the development version I get the right information. Standalone version I get blank answer boxes.

My process is when I make changes, I zip up the Application and upload it to the website. Both the Development version and the Standalone version download the version from the website.

I just do not get why the application runs in Development and not in Standalone
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

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

Re: DataGrid Inquiry

Post by Simon » Thu Apr 17, 2014 5:09 pm

Is this a mobile app?

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

gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Re: DataGrid Inquiry

Post by gpearson » Thu Apr 17, 2014 9:10 pm

No at this time this is a Desktop Application but once I get it working for the Desktop, I am wanting to create an iPad/Tablet Application. The application will not work on an iPhone due to the screen size.
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

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

Re: DataGrid Inquiry

Post by Simon » Thu Apr 17, 2014 10:40 pm

Hi Graham,
Can you post your stack here.
Much easier for us to debug.

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

gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Re: DataGrid Inquiry

Post by gpearson » Fri Apr 18, 2014 1:03 pm

Simon wrote:Hi Graham,
Can you post your stack here.
Much easier for us to debug.

Simon

Simon,

I sent you a PM with the information. The settings are for my machine which is tied to GitHub for Repository and allows me to delete directories easy as I go through a 3 stage application development procedure to make sure the applications I write are ready for prime time. I hope I gave you enough information as to where things are stored in the development mode of the application.
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

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

Re: DataGrid Inquiry

Post by Simon » Fri Apr 18, 2014 11:27 pm

Hi Graham,
I'm not having much luck running your app in the IDE
2014-04-18_1516.png
2014-04-18_1516.png (5.61 KiB) Viewed 7801 times
2014-04-18_1519.png
2014-04-18_1519.png (5.5 KiB) Viewed 7801 times
One thing I think you check the internet connection too soon, when I double click the stack it always errors. "no internet..."
It never wrote the LiveCode Projects folder but instead made a folder on my desktop (where the stack is).

Any chance you can make just a small example?

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

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: DataGrid Inquiry

Post by TerryL » Sat Apr 19, 2014 9:07 pm

Hi Graham.

From LiveCode Data Grid pdf:
"...When you build a standalone application Revolution looks for a substack whose name begins with "Data Grid Templates". If it finds one then the revDataGridLibrary stack is added to your standalone application. Some developers prefer to use a launcher (or splash) stack technique. This technique builds a standalone using a stack with very little code in it. In this case the stack used to build the standalone will not have a substack whose name begins with "Data Grid Templates" as no data grids have been added to it.
In this case you will need to create a substack that tricks the Standalone Builder into adding the necessary stack files. From the File menu, create a new substack of your launcher stack. Name the substack "Data Grid Templates Dud" [or "Data Grid Templates Decoy"] and save your launcher stack. Now if you build a standalone application the Standalone Builder will include the necessary data grid [library] stack."

Does that help any? Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Re: DataGrid Inquiry

Post by gpearson » Mon Apr 21, 2014 2:21 pm

Simon,

This is very interesting as on the line 508 it should have already downloaded the stack from the internet and extracted it. I guess it is time to go back to the drawing board. I will try and understand the next post and see where I get. As with every new thing I try and do, I will overcome at some point.
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

gpearson
Posts: 84
Joined: Wed Feb 03, 2010 12:55 pm

Re: DataGrid Inquiry

Post by gpearson » Mon Apr 21, 2014 2:34 pm

Terry,

Where did you acquire this "LiveCode Data Grid pdf" from? In my development of creating applications, I use the Dictionary, Tutorials, Resources from the IDE. Once I added this Data Grid Template Decoy to my Splash Screen Application, built a new application and ran it, the Data Grid on the Other Main Stack that is downloaded from the website which is the "Core" of the application started to work.


TerryL wrote:Hi Graham.

From LiveCode Data Grid pdf:
"...When you build a standalone application Revolution looks for a substack whose name begins with "Data Grid Templates". If it finds one then the revDataGridLibrary stack is added to your standalone application. Some developers prefer to use a launcher (or splash) stack technique. This technique builds a standalone using a stack with very little code in it. In this case the stack used to build the standalone will not have a substack whose name begins with "Data Grid Templates" as no data grids have been added to it.
In this case you will need to create a substack that tricks the Standalone Builder into adding the necessary stack files. From the File menu, create a new substack of your launcher stack. Name the substack "Data Grid Templates Dud" [or "Data Grid Templates Decoy"] and save your launcher stack. Now if you build a standalone application the Standalone Builder will include the necessary data grid [library] stack."

Does that help any? Terry
---
Graham Pearson
Goshen, IN USA

We Are Closed Today is your single internet resource for Indiana Area School Closings, Visit http://www.weareclosedtoday.com

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: DataGrid Inquiry

Post by Klaus » Mon Apr 21, 2014 3:48 pm

Hi Graham,
gpearson wrote:Where did you acquire this "LiveCode Data Grid pdf" from?
get it here: http://lessons.runrev.com/m/datagrid


Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”