[Seaside] Pondering if Dojo javascript toolkit is
more convenientthan Scriptaculous for Seaside solutions
Rick Flower
rickf at ca-flower.com
Thu May 10 23:12:21 UTC 2007
Boris Popov wrote:
> I don't see any harm in using whatever JS toolkit that would make your
> life easier. Here, for instance, we use both Scriptaculous/Prototype and
> YUI extensively, even mixed together,
>
> (html anchor)
> class: 'settings';
> onClick: (html
> yuipanel: editor
> config: [:v | v close: true]);
> with: 'Settings'
>
> where,
>
> yuipanel: component config: block
> (self updater)
> evalScripts: true;
> id: 'yuipaneltarget';
> onFailure: ((SUStream new)
> nextPutAll: 'displayGenericError();';
> yourself);
> callback: [:render |
> | dialog |
> dialog := (Seaside.YUIPanel new)
> immediate: true;
> delegate: component;
> yourself.
> block value: dialog.
> dialog renderContentOn: render];
> yourself
>
> So it's really up to you to decide what tool is right for the job.
When doing this sort of stuff (integrating a new js library w/ Seaside),
is there any rhyme or reason as to whether certain functionality should
be subclassed from WADecoration vs. WAComponent, etc and perhaps more
specifically how detailed it's "api" should be and if I should try to
use standardized keywords where possible? I've taken Boris'
latest (but a bit dated at this point) version of SeasideYUI and updated
the embedded js code for YUI, and added a first whack at yuimenu support
which I've got subclassed from WADecoration.. However, I'm finding that
the use of it is a bit verbose and it would be nicer to bury some of the
details in some form of an object and perhaps have it emit some of the
nested divs,etc.
I guess it might be nice to be able to do something like this -- in the
case of a yuimenu:
renderContentOn: html
html yuimenu id: #foo with: [
html yuimenuitem id: #bar with: [
html anchor callback: [ self blah ]; with: 'MyLink'
]
]
My initial code currently uses lots of nested divs, unordered lists,
list items, etc. Fairly verbose even for small menus.. Using something
like above would really hide a bunch of the crap behind the scenes..
But, perhaps people want to see that stuff? Anyway, just thought I'd ask..
More information about the seaside
mailing list