Hello,
thanks for your help.
class-store slot is the answer i'm looking for.
I do not need to create my own store,
instead i use memory store :
(make-instance 'weblocks-memory:memory-store)
A let to create this new store within each new session
and to use it with my "search widget" and the quickform.
Please watch the code here below :
(defwidget ldap-search-widget ()
((view :accessor ldap-s-view
:initform 'ldap-search-view
:initarg :view
:documentation "A form view for an LDAP search")
(search-store :accessor search-store
:initform nil
:initarg :search-store)
(quickform :accessor ldap-quickform
:initform nil
:initarg :quickform)))
(defun make-main-page ()
(let ((search-and-results (make-instance 'weblocks-memory:memory-store)))
(make-instance 'composite :widgets
(list
(make-instance 'ldap-search-widget
:search-store search-and-results)
(make-instance 'datalist
:name 'ldap-people
:class-store search-and-results
:data-class 'ldap-people
:item-data-view 'ldap-people-data-view)
(defmethod initialize-instance :after ((obj ldap-search-widget)
&rest initargs
&key &allow-other-keys)
(declare (ignore initargs))
(setf (ldap-quickform obj)
(make-quickform (ldap-s-view obj)
:class-store (search-store obj)
:on-success (lambda (w o)
(declare (ignore w))
(clean-ldap-results-store
(search-store obj))
(search-people (slot-value o 'name)
(search-store obj))
(mark-dirty (widget-parent obj))
(answer obj)))) )
Every new search (on-success lambda),
get results and mark dirty
the parent widget, but is this lambda the right place
to use mark-dirty ?
Thanks.
Best Regards.
--
Fred
>
--
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/weblocks/-/8OWElMTNX2gJ.
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.