I replaced some code in the layout.lisp file (weblocks-clsql-demo package) (see below),
and it works partially :
within the same session, if i add a new company, the menu is not refreshed,
i need to reset the session.
My Questions :
1) Use of "find-persistent-objects" is it the right way ?
2) How to refresh the menu without reset the session ?
(defun make-company-page (company)
(make-instance 'composite :widgets
(list
(lambda ()
(with-html (:p "Company data")
(:ul
(:li "Name : " (str (company-name company)))
(:li "ID : " (str (company-id company)))))))))(defun make-main-page ()
"Lays out the main page. It consists of a FLASH widget for showing
initial message, and a NAVIGATION widget with panes that hold
employees page and companies page."
(make-instance 'composite :widgets
(list
(make-instance 'flash :messages
(list "Welcome to weblocks demo - a
technology demonstration for a
continuations-based web
framework written in Common
Lisp."))
(let ((companies (weblocks:find-persistent-objects (class-store 'company) 'company)))
(if companies
(apply #'make-navigation
(cons 'main-menu
(loop for comp in companies
append (list
(company-name comp)
(make-company-page comp)))))
""))))) ;; (make-navigation 'main-menu
;; 'employees (make-employees-page)
;; 'companies (make-companies-page)))))
thanks
--
Fred