Refactor of Form Library #115

Open
cliftonc opened this Issue Sep 27, 2011 · 4 comments

Projects

None yet

4 participants

@cliftonc
Owner

The form library is a crucial part of Calipso, it allows both rendering and processing of forms in an extensible way, allowing forms to be defined, altered etc. programmatically (you can't do this if you leave forms purely in HTML).

It also ensures consistency and allows theming of forms.

Comments from conversation with Dennis:

I've been looking at my favorite part of the code - Forms.js. I feel like form elements need to be a little more organized. Case in point, I'd like the supported "form element types" to be more discoverable.

I'm several hours into a major Forms.js rewrite. The good news is - I think I can keep it fully or at least mostly 'backwards compatible'.

This rewrite is to pave the way for me to write my cherished cck module, based on your 'new content type' > "Custom Fields" work. I aspire to make calipso's "new content type" into a wizard similar to wufoo.

"old way":
form : { sections: [], fields: [], buttons: [] }

"new way":
form : { fields: [ { type: section, children: [] }, { type: section, children: [] }, { type: buttons, children: [] }

I wrestled with making the refactor more severe, by moving tag attributes into an "attr" property per field in the json. It's still something that might need to be done eventually, for more explicit--and more fool-proof and 'future-proof' (extensible)--definition of tag attributes.

I still need to work out whether or not to use CalipsoForm.prototype.method = ... everywhere, and then start adding some composite and custom field types, like address and email.

@dennishall dennishall was assigned Sep 27, 2011
Collaborator

Just an update to that last part - no need to take an early glance there, it's in the devel branch of calipso now (and updates will happen there).

Owner

Updated so we don't confuse anyone :)

Hey! What about field validators? Does calipso already have it? Or maybe it will be good idea to integrate it with forms api?

p.s. I'm newbie here and searching for some docs of calipso. I wanna to help with development and make blog for myself.

Regards,
Andy

Collaborator

There are field validators. Yes. Some fields need full text and some are html otherwise admin pages break. So sone fields have relaxed validators. It would be better to add new field types if you need stronger validation on some
Andy

Sent from my iPhone

On Mar 10, 2015, at 5:54 AM, Andy Tyurin notifications@github.com wrote:

Hey! What about field validators? Does calipso already have it? Or maybe it will be good idea to integrate it with forms api?

p.s. I'm newbie here and searching for some docs of calipso. I wanna to help with development and make blog for myself.

Regards,
Andy


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment