wrote this yesterday night - but was too tired to spell the address right, so here it is again.

I'm getting stuck - any hints are appreciated!

While I finally found out how to connect a +Chart component to a form
so that values are shown (Chart Put Function),
I do not get the clue how to bring changed values back (Chart Get Function).

I think I'm in trouble with differentiating between gui components connected
to vars/db objects and gui charts holding db objects and being connected to
gui components.

I've looked up the code in @app/ord.l etc and I studied on and on the chapters
in the tutorial concerning gui Charts and E/R Field Prefix Classes,
but I was not able to bring that together.

(class +Foo +Entity)
(rel keyA (+Ref +Number) 2)
(rel keyB (+Ref +String))

(dm keyA> () (: keyA) )
(dm keyB> () (: keyB) )

(de getFooObjs ( Floor Ceil )
(solve '( @F Floor
@C Ceil
(db keyA (@F . @C) @FooObj) )
@FooObj) )

==> ({234}{3224]{6342})

(html ....
(form NIL
(gui '(+Init +Chart) (getFooObjs 5 100) 3
'((FooObj) (list (keyA> FooObj) (keyB> FooObj) FooObj)) # put function
# no clue about get function
(<table> NIL NIL '((NIL "KeyA")(NIL "KeyB")(NIL "FooObj"))
(do 4
(<row> NIL
(gui 1 '(+Lock +NumField) 10)
(gui 2 '(+Lock +TextField) 10)
(gui 3 '(+Lock +TextField) 8)
## (gui '(+DelRowButton) "DEL")
) ) ) # table closed
(gui '(+UpButton) 1)
(gui '(+DnButton) 1)
(<submit> "Save")
) #form
) #html
) #action

This works for me, means: i can scroll through the records,
but want to change the values too.

1.) I wonder, if +Chart should be +E/R prefixed to the FooObjs
instead of using getFooObjs.
But how to do that?

2.) How could the Chart Get Function look like?
(sure +Locks will be deleted, when that function works)

3.) Or should the gui components be +E/R prefixed too,
but when is (: home obj) set and what arguments needs (gui +Chart then

4.) I only want to save 1 row at a time (or perhaps delete)
So I think, that <submit> will be thrown away (as it saves all records)
and a Save-Button will be added to the list of the <row> elements?

Or do I have to produce one form for each row?

Coding the insert form for one row at a time was done in a minute in the morning,

(form NIL
(gui 'a '(+NumField) 10)
(gui 'b '(+TextField) 20)
(gui '(+Button) "Insert Record"
'( (new! '(+Foo)
'keyA (val> (: home a))
'keyB (val> (: home b)) ) )

but now I think, this is not picolispish (= does not benefit of the pl qualities)
and could also be done with +Chart and E/R Prefix Class?

As Regenaxer told this morning: "as soon as there is activity needed, you need a form and then a +Chart" .

With kind regards,
and thank you very much in advance,


-- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to