I'll paste the output I get at the moment for review, non-link relations are
easy I think, I should have that covered so this is the output for a simple
link object:
(class +ArFeLink +Entity)
(rel article (+Ref +Link) NIL (+Article))
(rel feed (+Ref +Link) NIL (+Feed))
It is connecting articles and feeds.
First the menu:
(menu "Working with +ArFeLink"
(ifn *ID
(prog
(<h3> NIL "Select" " " "+ArFeLink")
(form 'dialog (choArFeLink)))
(<h3> NIL "+ArFeLink")
(form NIL
(<h2> NIL (<id> (: )))
(panel T (pack "+ArFeLink" " @1") '(T) '(choArFeLink) 'feed
'+ArFeLink)
(<grid> 2
"Article" (gui '(+ChoButton) '(choArticle (field 1)))
"Feed" (gui '(+ChoButton) '(choFeed (field 1))))
(<spread> NIL (editButton T)) ) ) )
And then choArFeLink:
(de choArFeLink (Dst)
(diaform '(Dst)
(<grid> "--."
"Feed" (gui 'feed '(+Var +TextField) '*ArFeLinkFeed 20)
"Article" (gui 'article '(+Var +TextField) '*ArFeLinkArticle 20)
(searchButton '(init> (: home query)))
(resetButton '(feed article query)))
(gui 'query '(+QueryChart) (cho)
'(goal
(quote
@Feed *ArFeLinkFeed
@Article *ArFeLinkArticle
(select (@@)
((title +Feed @Feed (feed +ArFeLink)) (title +Article @Article
(article +ArFeLink)) )
(tolr @Article @@ article title)
(tolr @Feed @@ feed title))))
3
'((This) (list This (: feed) (: article) )))
(<table> 'chart "+ArFeLink"
(quote
(btn)
(NIL "Article")
(NIL "Feed"))
(do (cho)
(<row> (alternating)
(gui 1 '(+DstButton) Dst)
(gui 2 '(+ObjView +TextField) '(: title))
(gui 3 '(+ObjView +TextField) '(: title)))))
(<spread>
(scroll (cho))
(newButton T Dst '(+ArFeLink)
'article *ArFeLinkArticle
'feed *ArFeLinkFeed)
(cancelButton))))
Did I miss something?
On Sun, Jan 17, 2010 at 9:34 AM, Alexander Burger <[email protected]>wrote:
> On Sat, Jan 16, 2010 at 09:31:27PM +0100, Henrik Sarvell wrote:
> > Just one final question, here is a gui example from the demo app:
> > ...
> > '((This) (list This (: nr) This (: sup) (: sup ort) (: pr))) )
> >
> > That last line seems to control what is shown in the columns of the
> > search result list,
>
> Correct.
>
> > that seems to imply some kind of convention at
> > work since (if that is the case) a call to This will display the 'nm
> > value, same goes for a plain (: sup) which will get the suppliers'
> > name. Correct or not?
>
> Absolutely correct. The above line puts a result list into the chart.
> Each element of that list must be of the proper type which the GUI
> element in that column expects.
>
> The code in the demo app for producing a single GUI line goes on as
>
> (<row> (alternating)
> (gui 1 '(+DstButton) Dst)
> (gui 2 '(+NumField))
> (gui 3 '(+ObjView +TextField) '(: nm))
> (gui 4 '(+ObjView +TextField) '(: nm))
> (gui 5 '(+TextField))
> (gui 6 '(+FixField) 2) ) ) )
>
> These six fields are in sync with the above data line
>
> This (: nr) This (: sup) (: sup ort) (: pr)
>
> That is, 'This' goes to the '+DstButton', so that this button contains
> the object, and can react appropriately to a click.
>
> The second element is the item number (: nr), a plain integer which is
> stored in a '+NumField'.
>
> Then 'This' is passed again, this time to an '+ObjView' text field, a
> field which holds an object and knows how to show it (here the name of
> the object (: nm)), and how to react on a click (jump to that object).
>
> Same goes for (: sup), the supplier. The '+ObjView' field displays the
> supplier's name, and jumps to that supplier if clicked.
>
> (: sup ort) is the city name in the supplier, a plain string. It is
> passed to a '+TextField'.
>
> (: pr) is the price and gets passed to a fixnum field with two decimal
> digits '(+FixField) 2'.
>
>
> > Btw I couldn't find the definition of (gui) despite doing a search in
> > the whole library, where is it?
>
> 'gui' is a function that gets defined at runtime, differently depending
> on whether the HTTP request is a GET or a POST. This happens in the
> 'let' statements in line 49 of "lib/form.l"
>
> (if *PRG
> (let gui
> '(()
> ... ) )
> (set "*App")
> (let gui
> '(@
> ...
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=unsubscribe
>