Thanks, will check all of this out and fix it.

I think, it is better here not to initialize the new object at all. So
> the 'newButton' would simply be:
>

What I want when creating a new object is for a choose form to appear just
like in the demo app and then for the chosen objects to be linked to
properly when the new object is saved, is the above doing that (after I've
fixed it)?


On Mon, Jan 18, 2010 at 8:52 AM, Alexander Burger <a...@software-lab.de>wrote:

> Hi Henrik,
>
> as I don't have a complete, runnable version, I just inspect the code
> and write down what catches my eye:
>
> (menu "Working with +ArFeLink"
>   (ifn *ID
>      (prog
>         (<h3> NIL "Select" " " "+ArFeLink")
>         (form 'dialog (choArFeLink)) )
>      (<h3> NIL "+ArFeLink")
>      (form NIL
>         (<h2> NIL (<id> (: )))
>                            ^
> Here I would expect some attribute, to be printed in the header. Perhaps:
>
>         (<h2> NIL (<id> (: article title)))
>
> or
>
>         (<h2> NIL (<id> (: feed title) " -- " (: article title)))
>
>
> In the 'panel' call, the argument for the "delete" permission
>
>         (panel T (pack "+ArFeLink" " @1") '(T) '(choArFeLink) 'feed
> '+ArFeLink)
>                                            ^
> could just be a simple 'T' if deletion is always allowed:
>
>         (panel T (pack "+ArFeLink" " @1") T '(choArFeLink) 'feed
> '+ArFeLink)
>
>
> The contents of the form are incomplete:
>
>         (<grid> 2
>           "Article" (gui '(+ChoButton) '(choArticle (field 1)))
>           "Feed" (gui '(+ChoButton) '(choFeed (field 1))) )
>         (<spread> NIL (editButton T)) ) ) )
>
> This will show only the titles and two buttons. The fields holding the
> actual objects (and where the buttons refer to with (field 1)), are
> missing. So I would write:
>
>         (<grid> 3
>            "Article" (gui '(+ChoButton) '(choArticle (field 1)))
>             (gui '(+E/R +Obj +TextField) '(article : home obj) '(title
> +Article) 30)
>             "Feed" (gui '(+ChoButton) '(choFeed (field 1)))
>             (gui '(+E/R +Obj +TextField) '(feed : home obj) '(title +Feed)
> 30) )
>         (<spread> NIL (editButton T)) ) ) )
>
> Note the '3' argument for <grid>, as now the table has three columns.
>
>
> In 'choArFeLink', the grid on top holding the search fields:
>
>      (<grid> "--."
>         "Feed" (gui 'feed '(+Var +TextField) '*ArFeLinkFeed 20)
>         "Article" (gui 'article '(+Var +TextField) '*ArFeLinkArticle 20)
>         (searchButton '(init> (: home query)))
>         (resetButton '(feed article query)) )
>
> This is probably not what is intended. The "--." argument to <grid> says
> that a 3-column table should be created, with two columns left-aligned
> and one column right-aligned. So correct would be:
>
>      (<grid> "--."
>         "Feed" (gui 'feed '(+Var +TextField) '*ArFeLinkFeed 20)
>          (searchButton '(init> (: home query)))
>          "Article" (gui 'article '(+Var +TextField) '*ArFeLinkArticle 20)
>          (resetButton '(feed article query)) )
>
> holding the search button also in the first row.
>
>
>      (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) ) ) )
>
> This looks good, however I'm not sure if the 'tolr' is correct. I don't
> remember the 'rel' definition for 'title' in '+Article' and '+Feed'.
>
> 'tolr' makes mostly sense if the class of that relation is (+Sn +Idx
> +String). If the relation is just a '+Ref', then 'head' should be used.
> If you have partials strings (typically (+Fold +Idx +String)) then
> 'part' should be used.
>
>
>      (<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) ) ) )
>
> This looks all good, except for
>
>         (newButton T Dst '(+ArFeLink)
>            'article *ArFeLinkArticle
>            'feed *ArFeLinkFeed )
>
> The 'article' and 'feed' arguments pass initial data to a new
> '+ArFeLink' object. However, that object expects other objects (article
> and feed), but the above will pass strings (the values of the search
> fields).
>
> I think, it is better here not to initialize the new object at all. So
> the 'newButton' would simply be:
>
>         (newButton T Dst '(+ArFeLink))
>
>
> Hope I didn't miss too many other problems. Just try it, and see what
> goes wrong ;-)
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe
>

Reply via email to