I dont think there is a case for duplicate widgets in the sense of dom
ids being identical if I understand you correctly.

Suppose you have a complicated-wodget you can simply say

(let ((a (make-instance 'complicated)
       (b (make-instance 'complicated)))
    (make-instance 'composite
                        :widgets (list a b)))

And they end up w differing dom ids. It's a great way to reuse
functionality and a killer feature of weblock's widget oriented
approach imho.



Sent from my iPad

On 01-Apr-2011, at 7:10 PM, radisb <[email protected]> wrote:

> I think there should be a check and a kind of handling (removal?) of 
> duplicates in the widgets argument of
> (defgeneric (setf widget-children) (widgets obj &optional type).
> Currently there is not any such check and so someone could do:
>
>       (let ((dup (make-dup-widget)))
>               (make-instance 'composite
>                       :widgets (list dup dup)))
>
> Since the above is accepted as it is , the first page load renders 2 widgets 
> with same id, but any subsequent ajax request always renders the first one
> because firstly, mark-dirty does this:
>  ...
>   (unless (widget-dirty-p w)
>      (push w *dirty-widgets*)
>  ...
> and widget-dirty-p will see the same object,
> and secondly even if somehow we pushed dup twice into *dirty-widgets* there 
> would be problem in the ajax response content handling by JS.
>
> Unless I am missing something, this should be resolved but i am not sure 
> about plain removal of the duplicate. Any suggestions?
>
> Could there be a legit use case of one widget being rendered twice in 
> different html places? And even if there is I am not sure if it could be 
> implemented by same widget rendered twice (in html space).
>
> Any suggestions?
> --
> 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.

-- 
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.

Reply via email to