<?xml version="1.0" encoding="utf-8"?>
<Application>
	<AppTitle>BGUK Create Table</AppTitle>
	<Author>Gaev Keeka</Author>
	<Version>2.0</Version>
	<Description>Create neoTable from JSON file</Description>
	<DesignDeviceName>Desktop</DesignDeviceName>
	<VariablesScanned>False</VariablesScanned>
	<PageWidth>800</PageWidth>
	<PageHeight>600</PageHeight>
	<AutoSizeWidth>False</AutoSizeWidth>
	<AutoSizeHeight>False</AutoSizeHeight>
	<HideScrollbars>False</HideScrollbars>
	<PublishPlatform>WebApp</PublishPlatform>
	<EmptyBuildFolder>False</EmptyBuildFolder>
	<LanguageCode>en</LanguageCode>
	<MobileOSTypes>[AndroidOS,iOS,WindowsPhoneOS]</MobileOSTypes>
	<WindowState>normal</WindowState>
	<TitleBar>True</TitleBar>
	<Sizeable>True</Sizeable>
	<MaximizeBtn>False</MaximizeBtn>
	<MinimizeBtn>True</MinimizeBtn>
	<SystemMenu>True</SystemMenu>
	<ContextMenu>False</ContextMenu>
	<AlwaysOnTop>False</AlwaysOnTop>
	<ShowInTaskbar>True</ShowInTaskbar>
	<SingleInstance>False</SingleInstance>
	<ChromeKioskMode>False</ChromeKioskMode>
	<startup>TopCenterApp</startup>
	<Components>
		<FunctionList name="Subroutines"/>
		<LibraryList name="Libraries"/>
		<PageList name="Main">
			<Components>
				<Page id="Page0">
					<Components>
						<Container id="neoTableContainer">
							<left>20px</left>
							<top>325px</top>
							<width>762px</width>
							<height>268px</height>
							<style>border-width:1px;border-style:solid;background-color:#fff;</style>
						</Container>
						<Container id="FileContent">
							<left>22px</left>
							<top>103px</top>
							<width>758px</width>
							<height>213px</height>
							<style>background-color:#fff;border-style:solid;border-width:1px;overflow-x:visible;overflow-y:auto</style>
							<html>[FileContent]</html>
						</Container>
						<PushButton id="FetchDataFromFile">
							<left>23px</left>
							<top>9px</top>
							<width>186px</width>
							<height>35px</height>
							<caption>Fetch Data From File</caption>
							<click>... feedback that command is being initiated
SetVar [FeedbackMessage] &quot;Starting LoadJSON for [FileToFetch]&quot;

... fetch content of file containing an array of json objects
LoadJSON &quot;[FileToFetch]&quot; [FileContent]

... feedback that command is completed
SetVar [FeedbackMessage] &quot;LoadJSON for [FileToFetch] has ended.&quot;

... get array length
ArrayLen [FileContent] [FileContentLen]

... feedback array length
SetVar [FeedbackMessage] &quot;Fetched data from [FileToFetch] has [FileContentLen] array items&quot;

</click>
						</PushButton>
						<Container id="FeedbackContainer">
							<left>22px</left>
							<top>54px</top>
							<width>756px</width>
							<height>43px</height>
							<style>border-width:1px;border-style:solid;background-color:#fff;</style>
							<html>[FeedbackMessage]</html>
						</Container>
						<PushButton id="ShowNeoTable">
							<left>214px</left>
							<top>9px</top>
							<width>186px</width>
							<height>35px</height>
							<caption>Show in neoTable Format</caption>
							<click>... Reset any previous column definitions
neoTableResetColumns &quot;neoTableContainer&quot;
... setup columns; IMPORTANT: column numbers MUST start at 1
neoTableSetColumn &quot;neoTableContainer&quot; 1 &quot;id&quot; &quot;Id&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;neoTableContainer&quot; 2 &quot;fname&quot; &quot;First Name&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;neoTableContainer&quot; 3 &quot;lname&quot; &quot;Last Name&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;neoTableContainer&quot; 4 &quot;email&quot; &quot;Email Address&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;neoTableContainer&quot; 5 &quot;gender&quot; &quot;Gender&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;neoTableContainer&quot; 6 &quot;ip_address&quot; &quot;IP Address&quot; &quot;&quot; false false false &quot;&quot;

... define user permissions
neoTableInitTable &quot;neoTableContainer&quot; &quot;&quot; 0 &quot;Table&quot; false false false false false &quot;&quot;
... load Data
neoTableLoadData &quot;neoTableContainer&quot; [FileContent]

... feedback that actions complete
SetVar [FeedbackMessage] &quot;Content from [FileToFetch] has been loaded as neoTable&quot;
</click>
						</PushButton>
					</Components>
				</Page>
				<Page id="Page1">
					<Components>
						<Container id="Page1Container">
							<left>22px</left>
							<top>103px</top>
							<width>750px</width>
							<height>480px</height>
							<style>background-color:#fff;border-style:solid;border-width:1px;overflow-x:visible;overflow-y:auto</style>
							<html>[loadedJSON]</html>
						</Container>
						<PushButton id="Page1LoadJSON">
							<left>170px</left>
							<top>52px</top>
							<width>98px</width>
							<height>35px</height>
							<caption>Load JSON</caption>
							<click>SetVar [loadedJSON] &quot;Starting LoadJSON for [FileToFetch]&quot;
LoadJSON &quot;[FileToFetch]&quot; [loadedJSON]
ArrayLen [loadedJSON] [loadedJSONArrayLen]
AlertBox &quot;Array Length&quot; &quot;[loadedJSONArrayLen]&quot; &quot;&quot;</click>
						</PushButton>
						<PushButton id="GoToPage2">
							<left>652px</left>
							<top>54px</top>
							<width>119px</width>
							<height>35px</height>
							<caption>Go to Page2</caption>
							<click>GotoPage &quot;Page2&quot;</click>
						</PushButton>
						<TextArea id="Page1FileToFetch">
							<left>26px</left>
							<top>13px</top>
							<width>748px</width>
							<height>34px</height>
							<variable>[FileToFetch]</variable>
							<init_value>http://visualneo.com/filedownloads/multirecord.json</init_value>
						</TextArea>
						<PushButton id="Page1OpenURL">
							<left>26px</left>
							<top>52px</top>
							<width>100px</width>
							<height>35px</height>
							<caption>OpenURL</caption>
							<click>SetVar [loadedJSON] &quot;Starting OpenURL for [FileToFetch]&quot;
OpenURL &quot;[FileToFetch]&quot;</click>
						</PushButton>
						<PushButton id="ShowJSONStrings">
							<left>324px</left>
							<top>52px</top>
							<width>144px</width>
							<height>36px</height>
							<caption>Show JSON Strings</caption>
							<click>... [lastItem] is length -1 (array item numbers are zero based)
SetVar [lastItem] [loadedJSONArrayLen]-1
Loop 0 [lastItem] [thisItem]
     ... extract json object items
     SetVar [thisJSONItem] &quot;[loadedJSON([thisItem])]&quot;
     AlertBox &quot;JSON Item [thisItem]&quot; &quot;fname = [thisJSONItem(&apos;fname&apos;)]&lt;br/&gt;lname =[thisJSONItem(&apos;lname&apos;)]&quot; &quot;&quot;
EndLoop</click>
						</PushButton>
					</Components>
				</Page>
				<Page id="Page2">
					<Components>
						<Container id="BasicTableContainer">
							<left>16px</left>
							<top>60px</top>
							<width>762px</width>
							<height>401px</height>
							<style>border-width:1px;border-style:solid;background-color:#fff;</style>
						</Container>
						<PushButton id="CreateTable">
							<left>152px</left>
							<top>14px</top>
							<width>128px</width>
							<height>32px</height>
							<caption>Create Table</caption>
							<click>... Reset any previous column definitions
neoTableResetColumns &quot;BasicTableContainer&quot;
... setup columns; IMPORTANT: column numbers MUST start at 1
neoTableSetColumn &quot;BasicTableContainer&quot; 1 &quot;id&quot; &quot;Id&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;BasicTableContainer&quot; 2 &quot;fname&quot; &quot;First Name&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;BasicTableContainer&quot; 3 &quot;lname&quot; &quot;Last Name&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;BasicTableContainer&quot; 4 &quot;email&quot; &quot;Email Address&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;BasicTableContainer&quot; 5 &quot;gender&quot; &quot;Gender&quot; &quot;&quot; false false false &quot;&quot;
neoTableSetColumn &quot;BasicTableContainer&quot; 6 &quot;ip_address&quot; &quot;IP Address&quot; &quot;&quot; false false false &quot;&quot;

... define user permissions
neoTableInitTable &quot;BasicTableContainer&quot; &quot;&quot; 0 &quot;Table&quot; false false false false false &quot;&quot;
... load Data
neoTableLoadData &quot;BasicTableContainer&quot; [mydata]</click>
						</PushButton>
						<PushButton id="CreateMydata">
							<left>18px</left>
							<top>14px</top>
							<width>130px</width>
							<height>32px</height>
							<caption>Create mydata</caption>
							<click>CreateEmptyArray [mydata]
Loop 0 [lastItem] [thisItem]
     SetVar [thisJSONItem] &quot;[loadedJSON([thisItem])]&quot;
     ArrayAddItem [mydata] [thisJSONItem]
EndLoop
ArrayLen [mydata] [mydataLen]
AlertBox &quot;mydata&quot; &quot;has [mydataLen] rows of data&quot; &quot;&quot;</click>
						</PushButton>
						<PushButton id="GoToPage1">
							<left>656px</left>
							<top>15px</top>
							<width>119px</width>
							<height>35px</height>
							<caption>Go to Page1</caption>
							<click>GotoPage &quot;Page1&quot;</click>
						</PushButton>
					</Components>
				</Page>
			</Components>
		</PageList>
		<PageList name="Master">
			<Components>
				<Page id="MasterPage"/>
			</Components>
		</PageList>
		<PageList name="Dialog">
			<Components>
				<Page id="NewDialog">
					<Components>
						<DialogContainer id="DialogContainer1">
							<left>0px</left>
							<top>0px</top>
							<width>800px</width>
							<height>600px</height>
							<close_button>False</close_button>
						</DialogContainer>
					</Components>
				</Page>
			</Components>
		</PageList>
	</Components>
</Application>
