On 3/27/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
>
> On Mon, March 27, 2006 9:22 am, Joe Germuska said:
> > I wonder if there's a way to generalize an "API" out of these so that
> > we are less bound to an implementation.  Certainly, a date picker or
> > rich text field which ultimately just ends up setting a value of  a
> > single form field should be not too hard to generalize, although I
> > haven't looked at all the models for integrating JS widgets into a
> > page neatly.  I guess there are also issues of triggering the
> > widgets, etc.
>
> Generalize an API out of GUI widgets?
>
> Where's Craig with the JSF plug when you need him?!? :-) LOL


Ask and ye shall receive :-)  [1]

Seriously, wrapping DOJO widgets (using whatever technology you like on the
server side) is a heck of a lot more fun than writing all that javascript
yourself, as long as the underlying widget does what you need.  I'm
currently playing with a JSF component wrapper for DOJO's rich text editing
capability.  Took about an hour to do the wrapping -- the only issues I've
got relate to the widget implementation itself (doesn't support scrollbars,
and problems hooking in to the Save and Cancel events where I want to).

I've also seen people try to generalize *all* DOJO widgets with a single JSP
tag API.  This is a lot more practical in JSP 2.0, where you can declare a
tag that takes arbitrary parameters.  But I worry about usability issues of
a single tag like this, because you effectively have a "mode" of operation
for every widget (which would each only recognize only a subset of the
overall set of attributes).  We have small examples of this sort of thing
all over the Struts tag library ... just for an example, try to explain to a
newbie what combination of attributes to use on an <html:frame> tag[2] when
you want to pass parameters in.

Wrapping is good, but I've come to believe in "one tag (or equivalent for
your favorite technology) per use case" is better than "one size fits all".

Frank


Craig

[1]
http://blogs.sun.com/roller/page/edwingo?entry=component_authoring_for_creator
[2] http://struts.apache.org/struts-taglib/tlddoc/html/frame.html

Reply via email to