<!x-stuff-for-pete base="" src="" id="0" charset="iso-8859-1/macintosh"><HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Johan<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I haven't looked at my knop test site for over a week, but I remember having an issue where when using an SQL statement (and hence Inlinename) I couldn't get it to pass the keyvalue to the knop_grid listing for the edit links. Of course it could be achieved now with a compound expression instead of using the -url parameter, but that seems overkill. Using a standard inline on the same page passed the keyvalue, as expected.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>One other observation from my experiments - unless I missed it completely, knop doesn't have a 'detail' page, as such, when you view a record, you'd always be in edit mode. Again, detail pages can be created manually, but this is such a common requirement and has a lot of crossover with the form type, that it would seem logical to have as an option in the framework.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Cheers,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ric</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR><DIV><DIV>On 18 Apr 2007, at 16:17, Johan Solve wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I thought it could be interesting to see some simple usage cases, as inspiration and to help understanding Knop. I'll begin with an example to output some fields from a specific database record, using the database type.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// initiate the database object (normally in a config file)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">var: 'db_news'=(knop_database: -database='acme', -table='news',</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>-username='knopuser', -password='knopuser',</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>-keyfield='id');</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// perform a database search to grab the record (normally in a lib file)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">$db_news -> (getrecord: -keyvalue=185);</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// show some fields from the database record (normally in a content file)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><h3>[$db_news -> (field: 'title')] </h3></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><p></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[encode_break: ($db_news -> (field: 'text'))]</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></p></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">----</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// The getrecord statement can be simplified slightly since the first parameter is the keyvalue</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">$db_news -> (getrecord: 185);</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// If a more complex query is needed to get the record, select can be used instead.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// The data from the first found record will be available as ->field</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">// (not in the current version, but in the next update).</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">$db_news -> (select: -sql='SELECT * FROM news LEFT JOIN ...');</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>Johan Sölve<SPAN class="Apple-converted-space"> </SPAN>[FSA Member, Lasso Partner]</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>Web Application/Lasso/FileMaker Developer</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>MONTANIA SOFTWARE & SOLUTIONS</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.montania.se">http://www.montania.se</A> <SPAN class="Apple-converted-space"> </SPAN><A href="mailto:joh-n@montania.se">mailto:joh-n@montania.se</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space"> </SPAN>(spam-safe email address, replace '-' with 'a')</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">#############################################################</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">This message is sent to you because you are subscribed to</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the mailing list <<A href="mailto:knop@lists.montania.se">knop@lists.montania.se</A>>.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To unsubscribe, E-mail to: <<A href="mailto:knop-off@lists.montania.se">knop-off@lists.montania.se</A>></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Send administrative queries to<SPAN class="Apple-converted-space"> </SPAN><<A href="mailto:knop-request@lists.montania.se">knop-request@lists.montania.se</A>></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">List archive <A href="http://lists.montania.se/Lists/knop/">http://lists.montania.se/Lists/knop/</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(log in with your email and ConfirmationID as password, send message to</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><<A href="mailto:knop-confirm@lists.montania.se">knop-confirm@lists.montania.se</A>> to get that ID)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Project homepage <A href="http://montania.se/projects/knop/">http://montania.se/projects/knop/</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">AIM chatroom knop <A href="aim:gochat?roomname=knop">aim:gochat?roomname=knop</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>
Apr 18
Johan Solve Knop usage - database
Apr 18, 2007; 17:17
Johan Solve
Knop usage - database
Apr 18
Johan Solve Re: Knop usage - database
Apr 18, 2007; 20:27
Johan Solve
Re: Knop usage - database
Apr 18
Ric Lewis Re: Knop usage - database
Apr 18, 2007; 23:11
Ric Lewis
Re: Knop usage - database
Apr 19
Ric Lewis Re: Knop usage - database
Apr 19, 2007; 09:57
Ric Lewis
Re: Knop usage - database
Apr 19
Johan Solve Re: Knop usage - database
Apr 19, 2007; 13:31
Johan Solve
Re: Knop usage - database
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!