-
- Command line
- Server Settings
- Commands
- Session
- Authentication
- Custom authentication
- External authentication
- Basic authentication
- Folder Security
- Data manipulation
- Read one record
- Read many records
- Write one record
- Delete one record
- Direct Page/DQL
- Page data definition
- Directory listing
- File handling
- Prism lists
- Data Defintions
- Get data definitions
- Create data Definitions
- Update data definitions
- Delete data definitions
- Definition format
- run dql
- run script
- A web page
- Page definition
- DQL pages
- Single file/memo DQL
- Single file/memo Page
- LiveText tags
- Url commands
- Tags
- How data is triggered in a page
- About DataEaseConnect
- checkquery
- callbacksuccess
- clearrecord
- connectonfieldchange
- convertvaltonumber
- decodequery
- deletedata
- deletetdf
- displayerrormsg
- doaction
- ensurequry
- fetchrecord
- fetchrecords
- finddatatype
- findfieldindef
- formdata
- formdefs
- forminit
- forminitdone
- formloaded
- generateid
- getcookied
- getdata
- getelement
- getfield
- getmyhost
- getnumlines
- getrecordcontent
- getrecorddef
- getrecordnofromurl
- gettdf
- gettablefromurl
- istrueval
- login
- logout
- makenewline
- multirecordinit
- newdata
- newtdf
- rundql
- populateoneselect
- selectpopulate
- setcsrfheader
- setelement
- setfield
- singlerecordinit
- stringify
- stripsuffix
- updatedata
- updatetdf
- useisodatetime
- usenumber
- version
- About jsBridge.js
- Action names
- deCheckVersion
- DEOS
- getnumlines
- GetCurrent
- GetValue
- GetVar
- jsAction
- jsActionExt
- jsActionExt2
- jsAddClass
- jsDEOS
- jsDerivation
- jsDerivationDebug
- jsDocumentDelete
- jsDocumentEdit
- jsDocumentOpen
- jsExecDQL
- jsGetActiveDocState
- jsGetVar
- jsGetCurrent
- jsGetDocumentState
- jsGetValue
- jsGetPRISMValue
- jsHide
- jsInt21
- jsLiveText
- jsLog
- jsMemoExecDQL
- jsMenuItem
- jsNewBlankForm
- jsOpenAppCat
- jsPrismDerivation
- runPrismFunction
- jsRefreshDocuments
- jsReorganize
- jsReorganizeAll
- jsRemoveClass
- jsSetFixedValue
- jsSetVarFromField
- jsSetValue
- jsSetVar
- jsSetCurrent
- jsSetWebField
- jsSetWebFieldFromVar
- jsShow
- jsToggle
- jsToggleClass
- makenewline
- SetCurrent
- SetValue
- SetVar
- startdebugger
- About decommon.js
- The loader
- calccaretpos
- decodequery
- generateid
- insertitem
- loadfilelist
- loadfile
- loadinternals
- message
- rundql
- runpage
- savefile
- selectitem
- testdql
- version
- .end
- .form header
- .form trailer
- .items
- assign
- application status
- backup db
- begin transaction
- break
- call menu
- call program
- case
- cluster by
- commit
- connect
- copy all from
- data-entry
- db status
- delete records
- define
- disconnect
- do
- documents
- exec SQL
- else
- end
- enter a record
- error messages off
- error messages on
- exit
- export
- for
- global
- if
- import
- imports
- in
- input using
- install application
- into
- list records
- lock
- lock db
- modify records
- message
- named
- others
- prompt
- query selection
- record entry
- records
- reorganize
- restore db
- rollback
- run procedure
- servers
- temp
- then
- tran off
- tran on
- unclustered
- unlock
- unlock db
- via form
- while
- with
- abs
- acos
- addressof
- ampm
- anylookup
- asin
- atan
- atan2
- ceil
- CHR
- concat
- ConsoleCopy
- ConsoleMemoCopy
- ConsoleShow
- ConsoleWriteToFile
- cos
- cosh
- date
- DatePicker
- day
- DEOS
- DialogOpen
- DialogOpenRelated
- DocumentCloseName
- DoesObjectExist
- ExecDQL
- ExecuteFile
- exp
- FileExecDQL
- firstc
- firstlast
- firstw
- FixedWidth
- floor
- futurevalue
- GetCurrent
- GetVar
- hours
- if
- installment
- jointext
- julian
- lastc
- lastfirst
- lastw
- length
- log
- log10
- lower
- MemoChunk
- MemoCopy
- MemoDecodePair
- MemoExecDQL
- MemoFind
- MemoGetGlobal
- MemoLength
- MemoMemoCopy
- MemoMemoReplace
- MemoReadFromFile
- MemoReplace
- MemoSetGlobal
- MemoStringBetween
- MemoStringFrom
- MemoStringTo
- MemoWordCount
- MemoWriteToFile
- midc
- midw
- minutes
- mod
- month
- OpenForm
- OpenMenu
- OpenProcedure
- OpenReport
- periods
- power
- presentvalue
- proper
- random
- rate
- RefreshForm
- RefreshScreen
- RefreshStatus
- Remote
- Remote authentication
- Remote POP3
- Remote IMAP
- Remote SMTP
- Remote XML
- seconds
- SetColor
- SetCurrent
- SetFocus
- SetLabelText
- SetMemoValue
- SetState
- SetStyle
- SetValue
- SetVar
- sin
- sinh
- spellcurrency
- spelldate
- spellmonth
- spellnumber
- spellweekday
- sqrt
- StringBetween
- StringEscape
- StringFind
- StringFrom
- StringReplace
- StringTo
- tan
- tanh
- textpos
- timeampm
- ToText
- UniqueID
- upper
- Wait
- weekday
- WriteToFile
- year
- yearday
- yearweek
- " (quotation marks)
- () (parentheses)
- + (addition)
- , (comma)
- - (subtraction)
- . (period)
- -- (comment)
- / (division)
- * (multiplication)
- * (asterisk)
- ? (question mark)
- ~ (tilde)
- : (colon)
- := (assignment operator)
- ; (semicolon)
- < (less than)
- <= (less than or equal to)
- = (equals)
- > (greater than)
- >= (greater than or equal to)
- all
- all files
- and
- any
- between
- blank
- count
- count of
- file
- highest of
- in groups
- in groups with group-totals
- in order
- in reverse
- item (Statistical)
- item (Conditional Statistical)
- lock files
- lock nothing
- lock records
- lookup
- lowest of
- max
- mean
- mean of
- min
- not
- number
- numeric string
- or
- pause
- percent
- selected record
- std.dev.
- std.err.
- sum
- sum of
- text
- time
- to
- variance
- window
- @GetDefinition
- . document
- . listcommands
- . listdocuments
- . listdrives
- . listfiles
- . listfunctions
- . listinternals
- . listoperators
- . listrelated
- . listtables
- . object
- . table
- . testdql
- @SetDefinition
- . document
- . object
Orders start
In the order system part of the demo, we can create, show, list, create and edit orders. All is done from the /demo/orderstart/ page. All urls for the demo order system starts on /demo/order and this is what is used in the template to select the correct tab as well.
The orders start page show a little menu and a list of addressees than can be selected using radio buttons. We could created this page the same way as the list address page by a simple DQL and items. Instead we will show a different way of selecting and displaying a list of data by using page data. The display of data is almost the same format as for the DQL, but how the system fetched the list of data is different.
Setting up what data to select
To do this we define a page and a .data section. The .data section is defined in the start of the document the same way as a .dql and the body section starts on the first . command after the data section as for the .dql. The body format can use the same .commands as for the.dql but you select the data to list by name instead of relying on the default.
.data [{ "tablename" : "Address" "type" : "list", "includefields" : [ "ID", "Name", "Address1", "Address2", "PostAddress", "PostCode", "EMail" ], "defaults" : [["ID","*"]] }] .end
The data selection that will select all matching records based on the query url. This data definition will return a list of records containing only the fields in listed in includefield under the name "Address" in the returning JSON. If you want to see this JSON code or use a data page using ajax, you can simply add json=1 to the query url and the json will be returned instead of the rendered page. The returned json will then return a { 'result' : 'ok', 'data' : thedatastructureasreturnedbytheserver }
<script> function createneworder() { debugger; var radioValue = $("input[name='customerid']:checked"). val(); if (radioValue) { var url = window.location.protocol + "//" + window.location.host + "/demo/ordercreate/?CustomerID=" + radioValue; window.location.href = url; } else alert("You must select a customer to create an order!"); }; function listorders() { debugger; var radioValue = $("input[name='customerid']:checked"). val(); if (radioValue) { var url = window.location.protocol + "//" + window.location.host + "/demo/orderlist/?CustomerID=" + radioValue; window.location.href = url; } else { var url = window.location.protocol + "//" + window.location.host + "/demo/orderlist"; window.location.href = url; } }; </script> <div class="row"> <br> <div class="col-sm-10"> <a class="btn btn-sm btn-info" onclick="createneworder();">New</a> <a class="btn btn-sm btn-info" onclick="listorders();">List</a> </div> </div> <br> <div class="row"> <table class="table"> .items in Address <tr> <td><input type="radio" name="customerid" value="[{ID}]"></td> <td>[{Name}]</td> <td>[{Address1}]</td> <td>[{Address2}]</td> <td>[{PostAddress}]</td> <td>[{PostCode}]</td> <td>[{EMail}]</td> </tr> .end </table> </div> <div class="row"> <h4>How this page works</h4> <p>This page is simply an data page that lists data from the Address table together with a body. The body uses the report format where .items in tablename will output a html table of the adressees. Each address can be selected to create a new order for the selected customer. The selection is done using a radio button. All radio buttons have the same name and the value of the customer id for each customer. This id is then read when you click one of the buttons and added to an url that either list orders or creates a new one.</p> <p>If you want to look at the actual code click to <a href="/cmd/openapp/">"Open in DataEase" link</a> and find ELM00011 in WebServer.</p> </div>
The body. The only difference from the address list in the first tab is the use of .items in tablename. This command tells the template to list records found in a element named Address. This element holds the list of Address records returned by the data selection in the .data part of the page.