How to make some rows in datagrid selected by default?

6 views
Skip to first unread message

kkspeed

unread,
Feb 5, 2012, 7:38:34 AM2/5/12
to weblocks
Hello, I'm new to weblocks. Even if with some previous experience with
Django, I find myself totally lost in Weblocks. I've got a few
questions.

1) I have a datagrid created as follows to make all items selected by
default:
(defun make-books-datagrid ()
(make-instance 'datagrid
:name 'books-data-grid
:data-class 'book
:view 'book-table-view
:widget-prefix-fn (lambda (&rest args)
(declare (ignore args))
(with-html (:h1 "Books")))
:allow-select-p t
:selection (cons :all nil)))
in the document, about :selection keywords, it says:
Contains a cons cell that identifies currently selected elements. That
'car' of the cell is either :all or :none. In case of :all, all items
except the ones in the cdr list are selected. In case of :none, none
of the elements except the ones in the cdr list are selected.

but when I've done compiling the form, the page would give me an error
message saying that :all has fallen through the ECASE:
:ALL fell through ECASE expression. Wanted one of (:NONE).

I'm wondering how to make some elements selected by default?

2) Even if finished reading the tutorial of "simple-blog", I'm still a
little bit confused about the parts "layout.lisp/views.lisp/widgets".
What roles do they actually play in weblocks framework? Currently I've
only got the impression that "layout" is responsible for organize the
widgets. views define a way of presenting the data and widgets take
in the data presented by views to form html elements. Does this
understanding make sense?

Any help will be appreciated.
Reply all
Reply to author
Forward
0 new messages