Re: working with persistent objects in a chart

2010-06-13 Thread Alexander Burger
Matthias,

thinking about it, my explanations yesterday were probably not very
enlightening. The matter is rather complex and involved.

The basic principle is that each entity has its 'url' method, to know
how to edit itself, and open a specific edit page when clicked upon.

To understand entities, GUI components like charts, and their
interactions, I would recommend to study some of the examples in the
distribution like the app/ demo, or the family database application in
doc/family.l. Also, the sources of the wiki http://home.picolisp.com/
(find the link in the Documentation section) might be helpful.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: working with persistent objects in a chart

2010-06-11 Thread Alexander Burger
Hi Matthias,

 (form NIL
 (gui '(+Chart) 3)
 (table NIL NIL '((NIL F1) (NIL F2) (NIL F3))
(do 4
 (row NIL
(gui 1 '(+TextField) 25)
(gui 2 '(+TextField) 25) 
(gui 3 '(+TextField) 25) ) ) )

This looks correct.


 If I understand the examples, I can connect the TextField with a +E/R
 prefix class to a relation

Right. The chart by itself can only handle a two-dimensional data
structure, i.e. a list of lists. Each row of the chart is filled with a
sublist, and the chart takes care of displaying the data, accept changes
and store them in the list of lists, scroll the contents, and so on.

So the chart must be given such a list of lists. It doesn't know
anything about the database or objects.


 but how do I select the correct object? Do
 I have to loop over all objects or does the chart do that for me?

As you observed, the +E/R class can do that. It connects a relation of
an entity to a GUI component, and says: Handle this relation for me.

How this exactly looks like depends very much on your actual situation.
If that relation is already a list of lists, i.e. a (+List +Bag)
relation, there is not more to do. In other cases you can pass
additional 'put' and 'get' functions to the +Chart, to have the
automatic conversions to/from the two-dimensional representation done
for you.

At other times, you don't connect the chart itself to an +E/R, but pass
it a list generated separately (e.g. as the result of a database search,
as is the case in the search dialogs). Typically this is done with
'+QueryChart', a subclass of '+Chart', which does the searching via a
Pilog query.


As you see, this is hard to explain without a concrete example.
Perhaps you can show where you got stuck at the moment?

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe