mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-05 18:20:36 -08:00
Remove run body in almost every case
This commit is contained in:
parent
c59ae62c32
commit
e5e3e07645
36 changed files with 199 additions and 121 deletions
|
|
@ -171,11 +171,7 @@ Here is a sample CLOG app:
|
|||
|
||||
(set-on-click hello-element ; Now we set a function to handle clicks
|
||||
(lambda (obj) ; In this case we use an anonymous function
|
||||
(setf (color hello-element) "green")))
|
||||
|
||||
(run body))) ; Keep our thread alive until connection closes
|
||||
; and prevent garbage collection of our CLOG-Objects
|
||||
; until no longer needed.
|
||||
(setf (color hello-element) "green"))))))
|
||||
|
||||
;; To see all the events one can set and the many properties and styles that
|
||||
;; exist, refer to the CLOG manual or the file clog-element.lisp
|
||||
|
|
|
|||
|
|
@ -210,8 +210,7 @@
|
|||
(set-on-before-unload (window body) (lambda(obj)
|
||||
(declare (ignore obj))
|
||||
;; return empty string to prevent nav off page
|
||||
""))
|
||||
(run body))
|
||||
"")))
|
||||
|
||||
(defun start-demo ()
|
||||
"Start demo."
|
||||
|
|
|
|||
|
|
@ -171,8 +171,7 @@
|
|||
(clog-web-initialize body)
|
||||
(create-web-frame body app)
|
||||
(reset-menu app)
|
||||
(route-content app "Home")
|
||||
(run body)))
|
||||
(route-content app "Home")))
|
||||
|
||||
(defun start-demo ()
|
||||
"Start dynamic website demo."
|
||||
|
|
|
|||
|
|
@ -4027,7 +4027,7 @@ CLOG-Builder. If not using builder use to connect:
|
|||
<a id="CLOG:DATABASE-CONNECTION%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:DATABASE-CONNECTION%20GENERIC-FUNCTION" >DATABASE-CONNECTION</a></span></span> <span class="locative-args">CLOG-OBJ</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:DATABASE-CONNECTION%20GENERIC-FUNCTION" >DATABASE-CONNECTION</a></span></span> <span class="locative-args">CLOG-DATABASE</span></span></p>
|
||||
|
||||
<p>Accessor to the database handle</p></li>
|
||||
</ul>
|
||||
|
|
@ -4038,7 +4038,31 @@ CLOG-Builder. If not using builder use to connect:
|
|||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[class]</span> <span class="reference-object"><a href="#CLOG:CLOG-ONE-ROW%20CLASS" >CLOG-ONE-ROW</a></span></span> <span class="locative-args"><a href="#CLOG:CLOG-ELEMENT%20CLASS" title="CLOG:CLOG-ELEMENT CLASS">CLOG-ELEMENT</a></span></span></p>
|
||||
|
||||
<p>Manipulate one row of a table.</p></li>
|
||||
<p>Manipulate one row of a table at a time on panel.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-ON-FETCH-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:SET-ON-FETCH%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:SET-ON-FETCH%20GENERIC-FUNCTION" >SET-ON-FETCH</a></span></span> <span class="locative-args">CLOG-ONE-ROW ON-FETCH-HANDLER</span></span></p>
|
||||
|
||||
<p>Set the <code>ON-FETCH-HANDLER</code> for <code>CLOG-ONE-ROW</code>. If <code>ON-FETCH-HANDLER</code>
|
||||
is nil unbind the event. The on-fetch event is called after the row was fetched
|
||||
and stored in (last-fetch clog-one-row) or nil if no row was returned, and before
|
||||
data-load-plist is called that will use the value of (last-fetch clog-one-row).
|
||||
Calculated fields, transformations to field values, etc. can be done in on-fetch as
|
||||
new-row will block until on-fetch returns.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-MASTER-ONE-ROW-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:SET-MASTER-ONE-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:SET-MASTER-ONE-ROW%20GENERIC-FUNCTION" >SET-MASTER-ONE-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW MASTER-ONE-ROW SLOT-NAME</span></span></p>
|
||||
|
||||
<p>Set <code>CLOG-ONE-ROW</code> to get-row setting a while-clause
|
||||
to follow slot-name of panel when <code>MASTER-ONE-ROW</code> calls next-row.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ACREATE-ONE-ROW-20GENERIC-FUNCTION-29"></a>
|
||||
|
|
@ -4047,15 +4071,18 @@ CLOG-Builder. If not using builder use to connect:
|
|||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CREATE-ONE-ROW%20GENERIC-FUNCTION" >CREATE-ONE-ROW</a></span></span> <span class="locative-args">CLOG-OBJ &KEY CLOG-DATABASE HIDDEN CLASS HTML-ID AUTO-PLACE</span></span></p>
|
||||
|
||||
<p>Create a new CLOG-One-Row element. A CLOG Database
|
||||
must be a parent to CLOG-One-Row.</p></li>
|
||||
<p>Create a new CLOG-One-Row element. If <code>CLOG-OBJ</code> is
|
||||
of type-of <code>CLOG-DATABASE</code> it is used as database source unless
|
||||
<code>:CLOG-DATABASE</code> is set.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ACLOG-DATABASE-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:CLOG-DATABASE%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CLOG-DATABASE%20GENERIC-FUNCTION" >CLOG-DATABASE</a></span></span> <span class="locative-args">OBJECT</span></span></li>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CLOG-DATABASE%20GENERIC-FUNCTION" >CLOG-DATABASE</a></span></span> <span class="locative-args">CLOG-OBJ</span></span></p>
|
||||
|
||||
<p>Access to the <code>CLOG-DATABASE</code></p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ATABLE-NAME-20GENERIC-FUNCTION-29"></a>
|
||||
|
|
@ -4114,26 +4141,33 @@ must be a parent to CLOG-One-Row.</p></li>
|
|||
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:LAST-FETCH%20GENERIC-FUNCTION" >LAST-FETCH</a></span></span> <span class="locative-args">OBJECT</span></span></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ALAST-SQL-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:LAST-SQL%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:LAST-SQL%20GENERIC-FUNCTION" >LAST-SQL</a></span></span> <span class="locative-args">OBJECT</span></span></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3AQUERY-ROW-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:QUERY-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:QUERY-ROW%20GENERIC-FUNCTION" >QUERY-ROW</a></span></span> <span class="locative-args">CLOG-OBJ PANEL SQL</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:QUERY-ROW%20GENERIC-FUNCTION" >QUERY-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL SQL</span></span></p>
|
||||
|
||||
<p>Ignore query related prperties and instead execute
|
||||
<code>SQL</code>. row-id-name is required for updates. All <code>PANEL</code> items or custom
|
||||
rows on panel will be set using <a href="#CLOG:DATA-LOAD-PLIST%20FUNCTION" title="CLOG:DATA-LOAD-PLIST FUNCTION"><code>DATA-LOAD-PLIST</code></a>.</p></li>
|
||||
slots on panel will be set using <a href="#CLOG:DATA-LOAD-PLIST%20FUNCTION" title="CLOG:DATA-LOAD-PLIST FUNCTION"><code>DATA-LOAD-PLIST</code></a>.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3AGET-ROW-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:GET-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:GET-ROW%20GENERIC-FUNCTION" >GET-ROW</a></span></span> <span class="locative-args">CLOG-OBJ PANEL</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:GET-ROW%20GENERIC-FUNCTION" >GET-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL</span></span></p>
|
||||
|
||||
<p>Get first row from a database table based on
|
||||
CLOG-OBJECT's table-name using where-clause and table-columns.
|
||||
row-id-name is required. All <code>PANEL</code> items or custom rows on panel will
|
||||
<code>CLOG-ONE-ROW</code>'s table-name using where-clause and table-columns.
|
||||
row-id-name is required. All <code>PANEL</code> items or custom slots on panel will
|
||||
be set using <a href="#CLOG:DATA-LOAD-PLIST%20FUNCTION" title="CLOG:DATA-LOAD-PLIST FUNCTION"><code>DATA-LOAD-PLIST</code></a>.</p></li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -4141,10 +4175,10 @@ be set using <a href="#CLOG:DATA-LOAD-PLIST%20FUNCTION" title="CLOG:DATA-LOAD-PL
|
|||
<a id="CLOG:NEXT-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:NEXT-ROW%20GENERIC-FUNCTION" >NEXT-ROW</a></span></span> <span class="locative-args">CLOG-OBJ PANEL</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:NEXT-ROW%20GENERIC-FUNCTION" >NEXT-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL</span></span></p>
|
||||
|
||||
<p>Get next row from a database table based on query
|
||||
made for get-row. All <code>PANEL</code> items or custom rows on panel will be set
|
||||
made for get-row. All <code>PANEL</code> items or custom slots on panel will be set
|
||||
using <a href="#CLOG:DATA-LOAD-PLIST%20FUNCTION" title="CLOG:DATA-LOAD-PLIST FUNCTION"><code>DATA-LOAD-PLIST</code></a>.</p></li>
|
||||
</ul>
|
||||
|
||||
|
|
@ -4152,21 +4186,21 @@ using <a href="#CLOG:DATA-LOAD-PLIST%20FUNCTION" title="CLOG:DATA-LOAD-PLIST FUN
|
|||
<a id="CLOG:INSERT-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:INSERT-ROW%20GENERIC-FUNCTION" >INSERT-ROW</a></span></span> <span class="locative-args">CLOG-OBJ PANEL</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:INSERT-ROW%20GENERIC-FUNCTION" >INSERT-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL</span></span></p>
|
||||
|
||||
<p>Insert new row in to database table based on
|
||||
CLOG-OBJECT's table-name and table-columns. <a href="#CLOG:DATA-WRITE-PLIST%20FUNCTION" title="CLOG:DATA-WRITE-PLIST FUNCTION"><code>DATA-WRITE-PLIST</code></a> is
|
||||
used to extract data from <code>PANEL</code> items and custom rows.</p></li>
|
||||
<code>CLOG-ONE-ROW</code>'s table-name and table-columns. <a href="#CLOG:DATA-WRITE-PLIST%20FUNCTION" title="CLOG:DATA-WRITE-PLIST FUNCTION"><code>DATA-WRITE-PLIST</code></a> is
|
||||
used to extract data from <code>PANEL</code> items and custom slots.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3AUPDATE-ROW-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:UPDATE-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:UPDATE-ROW%20GENERIC-FUNCTION" >UPDATE-ROW</a></span></span> <span class="locative-args">CLOG-OBJ PANEL</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:UPDATE-ROW%20GENERIC-FUNCTION" >UPDATE-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL</span></span></p>
|
||||
|
||||
<p>Update row in database table based on
|
||||
CLOG-OBJECT's table-name using current rowid and table-columns.
|
||||
<code>CLOG-ONE-ROW</code>'s table-name using current rowid and table-columns.
|
||||
row-id-name is required. All <code>PANEL</code> items or custom rows
|
||||
on panel will be retrieved from <code>PANEL</code> using <a href="#CLOG:DATA-WRITE-PLIST%20FUNCTION" title="CLOG:DATA-WRITE-PLIST FUNCTION"><code>DATA-WRITE-PLIST</code></a>.</p></li>
|
||||
</ul>
|
||||
|
|
@ -4175,7 +4209,7 @@ on panel will be retrieved from <code>PANEL</code> using <a href="#CLOG:DATA-WRI
|
|||
<a id="CLOG:CLEAR-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CLEAR-ROW%20GENERIC-FUNCTION" >CLEAR-ROW</a></span></span> <span class="locative-args">CLOG-OBJ PANEL</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CLEAR-ROW%20GENERIC-FUNCTION" >CLEAR-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL</span></span></p>
|
||||
|
||||
<p>Clear current rowid and all fields in <code>PANEL</code>
|
||||
using <a href="#CLOG:DATA-WRITE-PLIST%20FUNCTION" title="CLOG:DATA-WRITE-PLIST FUNCTION"><code>DATA-WRITE-PLIST</code></a> based on table-columns.</p></li>
|
||||
|
|
@ -4185,10 +4219,106 @@ using <a href="#CLOG:DATA-WRITE-PLIST%20FUNCTION" title="CLOG:DATA-WRITE-PLIST F
|
|||
<a id="CLOG:DELETE-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:DELETE-ROW%20GENERIC-FUNCTION" >DELETE-ROW</a></span></span> <span class="locative-args">CLOG-OBJ</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:DELETE-ROW%20GENERIC-FUNCTION" >DELETE-ROW</a></span></span> <span class="locative-args">CLOG-ONE-ROW PANEL</span></span></p>
|
||||
|
||||
<p>Delete a row from a database table based on
|
||||
current rowid</p></li>
|
||||
current rowid and then call <a href="#CLOG:CLEAR-ROW%20GENERIC-FUNCTION" title="CLOG:CLEAR-ROW GENERIC-FUNCTION"><code>CLEAR-ROW</code></a></p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ACLOG-LOOKUP-20CLASS-29"></a>
|
||||
<a id="CLOG:CLOG-LOOKUP%20CLASS"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[class]</span> <span class="reference-object"><a href="#CLOG:CLOG-LOOKUP%20CLASS" >CLOG-LOOKUP</a></span></span> <span class="locative-args"><a href="#CLOG:CLOG-ONE-ROW%20CLASS" title="CLOG:CLOG-ONE-ROW CLASS">CLOG-ONE-ROW</a> <a href="#CLOG:CLOG-SELECT%20CLASS" title="CLOG:CLOG-SELECT CLASS">CLOG-SELECT</a></span></span></p>
|
||||
|
||||
<p>CLOG Table Lookup Object</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ACREATE-LOOKUP-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:CREATE-LOOKUP%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CREATE-LOOKUP%20GENERIC-FUNCTION" >CREATE-LOOKUP</a></span></span> <span class="locative-args">CLOG-OBJ &KEY NAME MULTIPLE LABEL CLASS HTML-ID CLOG-DATABASE</span></span></p>
|
||||
|
||||
<p>Create a new clog-lookup as child of <code>CLOG-OBJ</code>.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3AVALUE-FIELD-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:VALUE-FIELD%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:VALUE-FIELD%20GENERIC-FUNCTION" >VALUE-FIELD</a></span></span> <span class="locative-args">OBJECT</span></span></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3AOPTION-FIELD-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:OPTION-FIELD%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:OPTION-FIELD%20GENERIC-FUNCTION" >OPTION-FIELD</a></span></span> <span class="locative-args">OBJECT</span></span></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ACLOG-DB-TABLE-20CLASS-29"></a>
|
||||
<a id="CLOG:CLOG-DB-TABLE%20CLASS"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[class]</span> <span class="reference-object"><a href="#CLOG:CLOG-DB-TABLE%20CLASS" >CLOG-DB-TABLE</a></span></span> <span class="locative-args"><a href="#CLOG:CLOG-ONE-ROW%20CLASS" title="CLOG:CLOG-ONE-ROW CLASS">CLOG-ONE-ROW</a> <a href="#CLOG:CLOG-TABLE%20CLASS" title="CLOG:CLOG-TABLE CLASS">CLOG-TABLE</a></span></span></p>
|
||||
|
||||
<p>CLOG Database Table View Object</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ACREATE-DB-TABLE-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:CREATE-DB-TABLE%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:CREATE-DB-TABLE%20GENERIC-FUNCTION" >CREATE-DB-TABLE</a></span></span> <span class="locative-args">CLOG-OBJ &KEY CLOG-DATABASE HIDDEN CLASS HTML-ID AUTO-PLACE</span></span></p>
|
||||
|
||||
<p>Create a new clog-db-table as child of <code>CLOG-OBJ</code>.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-ON-HEADER-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:SET-ON-HEADER%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:SET-ON-HEADER%20GENERIC-FUNCTION" >SET-ON-HEADER</a></span></span> <span class="locative-args">CLOG-DB-TABLE ON-HEADER-HANDLER</span></span></p>
|
||||
|
||||
<p>Set the <code>ON-HEADER-HANDLER</code> for <code>CLOG-DB-TABLE</code>. If <code>ON-HEADER-HANDLER</code>
|
||||
is nil unbind the event. The on-header event is called before the first row is output
|
||||
after the table is cleared to all adding a header information to the table.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-ON-FOOTER-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:SET-ON-FOOTER%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:SET-ON-FOOTER%20GENERIC-FUNCTION" >SET-ON-FOOTER</a></span></span> <span class="locative-args">CLOG-DB-TABLE ON-FOOTER-HANDLER</span></span></p>
|
||||
|
||||
<p>Set the <code>ON-FOOTER-HANDLER</code> for <code>CLOG-DB-TABLE</code>. If <code>ON-FOOTER-HANDLER</code>
|
||||
is nil unbind the event. The on-footer event is called after all rows are output
|
||||
after the table is cleared for adding footer information to the table.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-ON-ROW-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:SET-ON-ROW%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:SET-ON-ROW%20GENERIC-FUNCTION" >SET-ON-ROW</a></span></span> <span class="locative-args">CLOG-DB-TABLE ON-ROW-HANDLER</span></span></p>
|
||||
|
||||
<p>Set the <code>ON-ROW-HANDLER</code> for <code>CLOG-DB-TABLE</code>. If <code>ON-ROW-HANDLER</code>
|
||||
is nil unbind the event. The on-row event is called for each row. The row handler
|
||||
is passed also the clog-table-row object before the columns are added in second parameter to
|
||||
handler.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-ON-COLUMN-20GENERIC-FUNCTION-29"></a>
|
||||
<a id="CLOG:SET-ON-COLUMN%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:SET-ON-COLUMN%20GENERIC-FUNCTION" >SET-ON-COLUMN</a></span></span> <span class="locative-args">CLOG-DB-TABLE ON-COLUMN-HANDLER</span></span></p>
|
||||
|
||||
<p>Set the <code>ON-COLUMN-HANDLER</code> for <code>CLOG-DB-TABLE</code>. If <code>ON-COLUMN-HANDLER</code>
|
||||
is nil unbind the event. The on-column event is called for each column as added to
|
||||
the current row being processsed. It is passed also the keyworld symbol name of
|
||||
the column and the clog-table-column object.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3A-40CLOG-PANELS-20MGL-PAX-3ASECTION-29"></a>
|
||||
|
|
@ -4992,7 +5122,7 @@ or CLOG Data-List objects.</p></li>
|
|||
<a id="CLOG:ADD-SELECT-OPTION%20GENERIC-FUNCTION"></a></p>
|
||||
|
||||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:ADD-SELECT-OPTION%20GENERIC-FUNCTION" >ADD-SELECT-OPTION</a></span></span> <span class="locative-args">CLOG-SELECT VALUE CONTENT</span></span></p>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:ADD-SELECT-OPTION%20GENERIC-FUNCTION" >ADD-SELECT-OPTION</a></span></span> <span class="locative-args">CLOG-SELECT VALUE CONTENT &KEY SELECTED DISABLED</span></span></p>
|
||||
|
||||
<p>Add option <code>VALUE</code> to select.</p></li>
|
||||
</ul>
|
||||
|
|
@ -7065,9 +7195,8 @@ if confirmed or nil if canceled. <code>CANCEL-TEXT</code> is only displayed if m
|
|||
<ul>
|
||||
<li><p><span class=reference-bullet><span class=reference><span class="locative-type">[generic-function]</span> <span class="reference-object"><a href="#CLOG:RUN%20GENERIC-FUNCTION" >RUN</a></span></span> <span class="locative-args">CLOG-BODY</span></span></p>
|
||||
|
||||
<p>Keeps the connection thread alive to prevent garbage
|
||||
collection of local objects when not using connection-data objects
|
||||
or global objects.</p></li>
|
||||
<p>Keeps a connection thread alive to allow post
|
||||
user close of connection / browser.</p></li>
|
||||
</ul>
|
||||
|
||||
<p><a id="x-28CLOG-3ASET-HTML-ON-CLOSE-20GENERIC-FUNCTION-29"></a>
|
||||
|
|
|
|||
|
|
@ -47,15 +47,13 @@
|
|||
;;;;;;;;;
|
||||
|
||||
(defgeneric run (clog-body)
|
||||
(:documentation "Keeps the connection thread alive to prevent garbage
|
||||
collection of local objects when not using connection-data objects
|
||||
or global objects."))
|
||||
|
||||
(:documentation "Keeps a connection thread alive to allow post
|
||||
user close of connection / browser."))
|
||||
(defmethod run ((obj clog-body))
|
||||
(loop
|
||||
(if (validp obj)
|
||||
(sleep 10)
|
||||
(return))))
|
||||
(if (validp obj)
|
||||
(sleep 10)
|
||||
(return))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; set-html-on-close ;;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@
|
|||
(help-item (create-gui-menu-drop-down menu-bar :content "Help"))
|
||||
(help-about (create-gui-menu-item help-item :content "About" :on-click 'on-help-about))
|
||||
(full-screen (create-gui-menu-full-screen menu-bar)))
|
||||
(declare (ignore icon-item file-new help-about full-screen))
|
||||
(run body))))
|
||||
(declare (ignore icon-item file-new help-about full-screen)))))
|
||||
|
||||
(defun start-app ()
|
||||
(initialize 'on-new-window
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@
|
|||
;; and vertically our div on the screen.
|
||||
(let* ((layout (create-panel-box-layout body)))
|
||||
(center-children (center-panel layout))
|
||||
(create-div (center-panel layout) :content "Hello")
|
||||
(run body)))
|
||||
(create-div (center-panel layout) :content "Hello")))
|
||||
|
||||
(defun start-app ()
|
||||
(initialize 'on-new-window
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
;; and vertically our div on the screen.
|
||||
(let* ((layout (create-panel-box-layout body)))
|
||||
(center-children (center-panel layout))
|
||||
(create-div (center-panel layout) :content "Hello")
|
||||
(run body)))
|
||||
(create-div (center-panel layout) :content "Hello")))
|
||||
|
||||
(defun start-app ()
|
||||
(initialize 'on-new-window
|
||||
|
|
|
|||
|
|
@ -1518,8 +1518,7 @@ of controls and double click to select control."
|
|||
(set-on-before-unload (window body) (lambda(obj)
|
||||
(declare (ignore obj))
|
||||
;; return empty string to prevent nav off page
|
||||
""))
|
||||
(run body)))
|
||||
""))))
|
||||
|
||||
(defun clog-builder (&key static-root)
|
||||
"Start clog-builder."
|
||||
|
|
|
|||
|
|
@ -24,12 +24,8 @@
|
|||
(set-on-click hello-element ; Now we set a function to handle clicks
|
||||
(lambda (obj) ; In this case we use an anonymous function
|
||||
(declare (ignore obj))
|
||||
(setf (color hello-element) :green)))
|
||||
(setf (color hello-element) :green)))))
|
||||
|
||||
(run body))) ; Keep our thread alive until connection closes
|
||||
; and prevent garbage collection of our CLOG-Objects
|
||||
; until no longer needed.
|
||||
|
||||
;;; To see all the events one can set and the many properties and styles that
|
||||
;;; exist, take a look through the CLOG manual or the file clog-element.lisp
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@
|
|||
(dotimes (n x)
|
||||
(create-child body
|
||||
(format nil "<p>Clicked ~A times.</p>" x))
|
||||
(scroll-to (window body) 0 (height body))))))
|
||||
(run body)))
|
||||
(scroll-to (window body) 0 (height body))))))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
(dotimes (n y)
|
||||
(create-p body
|
||||
:content (format nil "Clicked ~A times." y))
|
||||
(sleep y)))))) ;)
|
||||
(run body)))
|
||||
(sleep y)))))))) ;)
|
||||
|
||||
;;; Running this version of the last tutorial and clicking quickly on the (click me!)
|
||||
;;; will demonstrate an important aspect of CLOG, events can happen in _parallel_.
|
||||
|
|
|
|||
|
|
@ -14,8 +14,7 @@
|
|||
(set-on-click (create-section body :h1 :content "Hello World! (click me!)")
|
||||
'my-on-click)
|
||||
(set-on-click (create-section body :h3 :content "Click me too!")
|
||||
'my-on-click)
|
||||
(run body))
|
||||
'my-on-click))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@
|
|||
(set-on-click (create-section body :h1 :content "Hello World! (click me!)")
|
||||
'my-on-click)
|
||||
(setf (connection-data-item body "changer")
|
||||
(create-section body :h1 :content "I change"))
|
||||
(run body))
|
||||
(create-section body :h1 :content "I change")))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
"On-new-window handler."
|
||||
(setf (title (html-document body)) "Tutorial 6")
|
||||
(set-on-click (create-section body :h1 :content "(click me to start!)")
|
||||
'my-on-click)
|
||||
(run body))
|
||||
'my-on-click))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -75,8 +75,6 @@
|
|||
(sleep .02))))
|
||||
(error (c)
|
||||
(format t "Lost connection.~%~%~A" c))))
|
||||
;;; There is no reason to run (run body) here as we check for (validp body)
|
||||
;;; and once the connection dies so does the on-new-window thread.
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -93,8 +93,7 @@
|
|||
(set-on-mouse-down div2 'on-mouse-down)
|
||||
(setf (positioning div3) :absolute)
|
||||
(set-on-touch-start div3 'on-mouse-down)
|
||||
(set-on-mouse-down div3 'on-mouse-down)
|
||||
(run body)))
|
||||
(set-on-mouse-down div3 'on-mouse-down)))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -153,8 +153,7 @@
|
|||
(select-tab p2)))
|
||||
(set-on-click t3 (lambda (obj)
|
||||
(setf last-tab obj)
|
||||
(select-tab p3))))
|
||||
(run body)))
|
||||
(select-tab p3))))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@
|
|||
(begin-path cx)
|
||||
(ellipse cx 200 200 50 7 0.78 0 6.29)
|
||||
(path-stroke cx)
|
||||
(path-fill cx)
|
||||
(run body)))
|
||||
(path-fill cx)))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -67,8 +67,7 @@
|
|||
;; We need to override the boostrap default to submit the form html style
|
||||
(set-on-submit form (lambda (obj)(declare (ignore obj))()))
|
||||
(set-on-click good-button 'on-click-good)
|
||||
(set-on-click scary-button 'on-click-scary))
|
||||
(run body)))
|
||||
(set-on-click scary-button 'on-click-scary))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start tutorial."
|
||||
|
|
|
|||
|
|
@ -39,25 +39,21 @@
|
|||
<li><a href='/page3'>/page3</a> - tutorial 11 as part of this tutorial
|
||||
<li><a href='/tutorial/tut-11.html'>/tutorial/tut-11.html</a> - an html file using boot.js
|
||||
<li><a href='/tutorial/regular-file.html'>'/tutorial/regular-file.html</a> - a regular html file
|
||||
</ul>")
|
||||
(run body))
|
||||
</ul>"))
|
||||
|
||||
(defun on-page1 (body)
|
||||
(create-div body :content "You are in on-page1")
|
||||
(run body))
|
||||
(create-div body :content "You are in on-page1"))
|
||||
|
||||
(defun on-page2 (body)
|
||||
(create-div body :content "You are in on-page2")
|
||||
(log-console (window body) "A message in the browser's log")
|
||||
(run body))
|
||||
(log-console (window body) "A message in the browser's log"))
|
||||
|
||||
(defun on-default (body)
|
||||
(cond ((equalp (path-name (location body))
|
||||
"/tutorial/tut-11.html")
|
||||
(on-tutorial11 body))
|
||||
(t
|
||||
(create-div body :content "No dice!")
|
||||
(run body))))
|
||||
(create-div body :content "No dice!"))))
|
||||
|
||||
(defun on-tutorial11 (body)
|
||||
(let* ((form (attach-as-child body "form1" :clog-type 'clog-form))
|
||||
|
|
@ -82,8 +78,7 @@
|
|||
;; We need to override the boostrap default to submit the form html style
|
||||
(set-on-submit form (lambda (obj)(declare (ignore obj))()))
|
||||
(set-on-click good-button 'on-click-good)
|
||||
(set-on-click scary-button 'on-click-scary))
|
||||
(run body)))
|
||||
(set-on-click scary-button 'on-click-scary))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
(in-package :hello-clog)
|
||||
|
||||
(defun on-new-window (body)
|
||||
(create-div body :content "Hello World!")
|
||||
(run body))
|
||||
(create-div body :content "Hello World!"))
|
||||
|
||||
(defun start-app ()
|
||||
(initialize 'on-new-window
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ Changes made to a local key will fire an event and print below:<br>"
|
|||
"my-local-key"
|
||||
(storage-element (window body) :local "my-local-key")
|
||||
"my-session-key"
|
||||
(storage-element (window body) :session "my-session-key")))
|
||||
(run body))
|
||||
(storage-element (window body) :session "my-session-key"))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
(set-on-click vst (lambda (obj)(declare (ignore obj))(pause-media vid)))
|
||||
(set-on-click ast (lambda (obj)(declare (ignore obj))(pause-media aud)))
|
||||
(set-on-time-update vid (lambda (obj)(declare (ignore obj))(setf (value vlc) (media-position vid))))
|
||||
(set-on-time-update aud (lambda (obj)(declare (ignore obj))(setf (value alc) (media-position aud))))
|
||||
(run body)))
|
||||
(set-on-time-update aud (lambda (obj)(declare (ignore obj))(setf (value alc) (media-position aud))))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -51,8 +51,7 @@
|
|||
(setf (attribute alert "role") "alert")
|
||||
(setf (attribute btn "data-dismiss") "alert")
|
||||
(place-after nav alert))))
|
||||
(set-on-click l3 (lambda (obj)(declare (ignore obj))(setf (color jname) (rgb 128 128 0)))))
|
||||
(run body))
|
||||
(set-on-click l3 (lambda (obj)(declare (ignore obj))(setf (color jname) (rgb 128 128 0))))))
|
||||
|
||||
(defun on-page2 (body)
|
||||
;; Since page2 is a new browser page we need to reload our bootstrap files.
|
||||
|
|
@ -70,8 +69,7 @@
|
|||
;; Jumbotron
|
||||
(jumbo (create-div body :class "jumbotron text-center"))
|
||||
(jname (create-section jumbo :h1 :content "You found Page2")))
|
||||
(declare (ignore l1) (ignore l2) (ignore l3) (ignore l4) (ignore jname)))
|
||||
(run body))
|
||||
(declare (ignore l1) (ignore l2) (ignore l3) (ignore l4) (ignore jname))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -76,22 +76,19 @@
|
|||
(create-div body
|
||||
:content (format nil "yourname3 = using NAME-VALUE ~A or VALUE ~A"
|
||||
(name-value form3 "yourname3")
|
||||
(value finput3)))))))
|
||||
(run body))
|
||||
(value finput3))))))))
|
||||
|
||||
(defun on-page2 (body)
|
||||
(let ((params (form-post-data body)))
|
||||
(create-div body :content params)
|
||||
(create-div body :content (format nil "yourname = ~A"
|
||||
(form-data-item params "yourname"))))
|
||||
(run body))
|
||||
(form-data-item params "yourname")))))
|
||||
|
||||
(defun on-page3 (body)
|
||||
(let ((params (form-get-data body)))
|
||||
(create-div body :content params)
|
||||
(create-div body :content (format nil "yourname = ~A"
|
||||
(form-data-item params "yourname"))))
|
||||
(run body))
|
||||
(form-data-item params "yourname")))))
|
||||
|
||||
(defun on-page4 (body)
|
||||
(let ((params (form-multipart-data body)))
|
||||
|
|
@ -105,8 +102,7 @@
|
|||
(let ((c (read-sequence b s)))
|
||||
(unless (plusp c) (return))
|
||||
(princ (subseq b 1 c))))))
|
||||
(delete-multipart-data body))
|
||||
(run body))
|
||||
(delete-multipart-data body)))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start tutorial."
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@
|
|||
(set-on-drop target2 (lambda (obj data)
|
||||
(declare (ignore obj))
|
||||
(print (getf data :drag-data))
|
||||
(place-inside-bottom-of target2 object)))
|
||||
(run body)))
|
||||
(place-inside-bottom-of target2 object)))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start tutorial."
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
(item (create-list-item list-b :content "Item 4")))
|
||||
(declare (ignore item))
|
||||
(js-execute body (format nil "JSLists.applyToList('~A', 'ALL');"
|
||||
(html-id list-top))))
|
||||
(run body))
|
||||
(html-id list-top)))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start tutorial."
|
||||
|
|
|
|||
|
|
@ -66,8 +66,7 @@
|
|||
(item (create-list-item list-b :content "Item 3"))
|
||||
(item (create-list-item list-b :content "Item 4")))
|
||||
(declare (ignore item))
|
||||
(clog-toggler:activate toggler))
|
||||
(run body))
|
||||
(clog-toggler:activate toggler)))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start tutorial."
|
||||
|
|
|
|||
|
|
@ -54,8 +54,7 @@ on the drop-root."))
|
|||
(item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 2"))
|
||||
(item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 3"))
|
||||
(item (create-list-item (clog-drop-list:drop-root drop-list) :content "Item 4")))
|
||||
(declare (ignore item)))
|
||||
(run body))
|
||||
(declare (ignore item))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start tutorial."
|
||||
|
|
|
|||
|
|
@ -153,8 +153,7 @@
|
|||
(set-on-before-unload (window body) (lambda(obj)
|
||||
(declare (ignore obj))
|
||||
;; return empty string to prevent nav off page
|
||||
""))
|
||||
(run body))
|
||||
"")))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@
|
|||
(bordeaux-threads:signal-semaphore hold)))
|
||||
(bordeaux-threads:wait-on-semaphore hold :timeout 60)
|
||||
(create-div body :content "Thank you for answering!")))
|
||||
:one-time t)
|
||||
(run body))
|
||||
:one-time t))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -99,8 +99,7 @@
|
|||
(defun start-tutorial ()<br>
|
||||
\"Start turtorial.\"<br>
|
||||
(initialize 'on-new-window)<br>
|
||||
(open-browser))")
|
||||
(run body)))
|
||||
(open-browser))")))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@
|
|||
(set-height)
|
||||
(set-on-resize (window body) (lambda (obj)
|
||||
(declare (ignore obj))
|
||||
(set-height)))))
|
||||
(run body))
|
||||
(set-height))))))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -93,8 +93,7 @@
|
|||
:class "w3-text-white w3-xlarge")))
|
||||
(setf (text-shadow txt) "2px 2px black")
|
||||
(composite-right txt :padding-class :padding-64)
|
||||
(setf (box-width image) "100%"))
|
||||
(run body))
|
||||
(setf (box-width image) "100%")))
|
||||
|
||||
(defun start-tutorial ()
|
||||
"Start turtorial."
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@
|
|||
(setf (url-src viewer) (format nil "/img/~A"
|
||||
(value lbox)))))
|
||||
;; Setup Bottom
|
||||
(center-children (bottom-panel console) :horizontal nil)
|
||||
(run body)))
|
||||
(center-children (bottom-panel console) :horizontal nil)))
|
||||
|
||||
(defun start-tutorial ()
|
||||
(initialize 'on-new-window)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue