wiki:IntroWidgetComponents
close Warning: Can't synchronize with repository "(default)" (/project/ucw/svn does not appear to be a Subversion repository.). Look in the Trac log for more information.

Yaclml tags <- back | toc | forward -> Nested Components (:|,) containers and tabbed panes

Widget components

A widget component is a normal class which wraps the contents of a render method in a div or a span. Widget components sound more weighty then they are. They don't inherit from a standard component, but are it's brothers. Components which inherit from them inherit the slots css-class, css-style and css-id, which are used in the :wrapping method of a render method. For the interested: arnesi, on which ucw depends, utilizes define-method-combination for some extra method combo's. According to the source in /path/to/arnesi_dev/src/mop.lisp it allows a method to have the

"Same semantics as standard method combination but allows
"wrapping" methods. Ordering of methods:
    
(wrap-around
  (around
    (before)
    (wrapping
      (primary))
    (after)))
    
:warp-around, :around, :wrapping and :primary methods call the
next least/most specific method via call-next-method (as in
standard method combination).
    

There's not so much to them widget components. Defining them like this wraps it's content in a div with the attributes class, id and style:

(defclass widget-test (widget-component)
  ()
  (:default-initargs  :css-class '("bla" "blop") :css-id "widget-test" :css-style "font-size: 30pt; color: fuchsia"))
    
(defmethod render ((comp widget-test))
  (<:ah "bla"))
    

Let widget-test inherit from inline-widget-component instead to wrap your content in a span.

Yaclml tags <- back | toc | forward -> Nested Components (:|,) containers and tabbed panes

Last modified 13 years ago Last modified on Jul 25, 2006, 11:24:17 AM