Differences between widgets and elements

8 views
Skip to first unread message

Brian Chamberlain (breakpointer)

unread,
Sep 16, 2010, 11:59:55 AM9/16/10
to inputex
Hi, I'm a little confused on the differences between widgets and
elements in inputex. Could someone explain what they are and when you
should want to build your own element vs build your own widget?

I'm also a little unclear when you have to register an element. Could
someone explain that too?

Thanks,
Brian

Eric Abouaf

unread,
Sep 19, 2010, 7:05:57 AM9/19/10
to inp...@googlegroups.com
Hi Brian,

First, what you call "elements" are called "fields" in inputEx.
The important difference between "fields" and "widgets" is simple :

All fields inherit from the inputEx.Field class
(some inherits it indirectly through other field classes...)

The inputEx.Field class provides a common set of methods that are expected to work on all fields.
This common abstraction makes it possible to nest standard fields into "meta"-fields (such as form, inplace-edit, ...)

The widgets are not meant to be inserted into forms. They are simply helpers to provide frequently-used
user interface using inputEx forms.

For example :
 * the dialog widget create a YUI dialog containing an inputEx Form.
 * the datatable extends the YUI datatable to use inputEx fields
 * ...

Finally inputEx.register only register fields.
This is necessary if you want to create a field using json:

fields: [
   {type: "text", label:"name"},
   {type: "my-custom-type", label: "test" }
]

I'll try to compile this into an inputEx guide ....

++


--
You received this message because you are subscribed to the Google Groups "inputex" group.
To post to this group, send email to inp...@googlegroups.com.
To unsubscribe from this group, send email to inputex+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/inputex?hl=en.




--
Eric Abouaf
eric....@gmail.com
Tél: 06 29 86 37 89

Brian Chamberlain

unread,
Sep 19, 2010, 9:57:07 PM9/19/10
to inp...@googlegroups.com
Thanks Eric. That was a very helpful explanation. Putting it in the docs would certainly be a help to people just picking up inputEx for the first time.
-Brian

blcham...@gmail.com
@breakpointer
Reply all
Reply to author
Forward
0 new messages