On Mar 31, 4:14 pm, "Leslie P. Polzer" <[email protected]>
wrote:
> > 1. I define a widget page-widget which inherit dataform, if I do not
> > define its render-widget-body method, its instance do not get be
> > rendered like dataform, I must write this code:
> > (defmethod render-widget-body ((obj page-widget) &key)
> > (call-next-method))
>
> > so widget do not call its parent widget's render method?
>
> Impossible. Your call-next-method above reflects the CLOS default
> behaviour. My guess it that you had some old method lying around
> that you needed to redefine this way.
>
> Check out the specialized methods in (describe #'render-widget-body)
Sorry, It maybe my wrong impression during the process of evolving
code. Now I discover it is OK.
>
> > 2. I define a widget wiki-widget to host all pages of wiki, code like
> > this:
> > ...
> > (setf (composite-widgets (pages wiki-widget))
> > (mapcar
> > (lambda (page)
> > (wiki-make-page-widget wiki-widget page))
> > (all-pages)))
> > ...
>
> > it will shows all pages when it dataform-ui-state is :data, but if I
> > click the modify link of one page, it does not change its state
> > from :data to :form, I must refresh the page in browser to see it.
>
> Can you show us the definition for wiki-make-page-widget
> and the page widget class?
(defgeneric wiki-make-page-widget (wiki-widget page)
(:documentation "make a POST-WIDGET containing POST. (called by
RESET-WIKI)")
(:method ((wiki-widget wiki-widget)
(page page))
(make-instance 'page-widget
:wiki wiki-widget
:data page
:data-view 'page-data-view
:form-view 'page-form-view
:on-select (lambda (page-widget)
;(setf (current-page wiki-widget) page-
widget)
;(setf (mode wiki-widget) :page)
(setf (dataform-ui-state page-
widget) :form)
; (mark-dirty page-widget)
; (setf (current-page wiki-widget) page-
widget)
(mark-dirty wiki-widget)
)
:on-cancel (lambda (page-widget)
(declare (ignore page-widget))
(mark-dirty wiki-widget)))))
(defwidget page-widget (dataform)
((wiki :accessor wiki-widget
:initarg :wiki)
; (mode :accessor mode
; :initarg :mode)
(on-select :accessor on-select
:initarg :on-select :initform nil
:documentation "Function to be called when this page is
selected. It accepts POST-WIDGET as argument."))
(:documentation "widget to handle a wiki page"))
Please check it, Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---