Fred <[email protected]> writes:

> Hello,
>
> in my previous code, i store ldap results into a memory store,
> but stores are shared between widgets, isn't it ?

I am not sure exactly what previous code you are refering to, but
I don't think it matters.
>
> So on different request from different web browser,
> the same store is used and the data are overwritten.
>
> How do i store the data from the search widget ?
> In a slot of the widget ? But how can i inform the datalist widget about 
> this data ?

One way of doing this is to write your own store.  This might sound
scarier than it really is.  For example write a class called:

search-key-and-results

which implements the store interface. 
Almost all methods of the store interface can be no-ops.
The only two that are really important for displaying are:

(defmethod find-persistent-objects ((store hash-store) class-name 
                                    &key order-by range &allow-other-keys)

(defmethod count-persistent-objects ((store hash-store) class-name &key 
&allow-other-keys)
  (hash-table-count (data store)))


Also add to the search-key-and-results class an ivar 'search-string'.

If build your class search-key-and-results in such a way, you can
do roughly the following:

...
        (let ((search-and-results (make-instance 'search-key-and-result)))
           ...
           (make-instance 'quickform :data search-and-results .....)
           (make-instance 'datalist :class-store search-and-results))

....

Now your datalist can access your search results using the store
interface.

The quickform will render your search box, using the normal mechanisms,
so you can modify the 'search-string' slot.

One thing that will not work out of the box is that you have to call
mark-dirty on your datalist widget after the content of your 
search results is changed.

Kind regards,
Wim Oudshoorn.

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en.

Reply via email to