On Sat, 17 Mar 2012 08:52:53 +0100
Roger Martín <[email protected]> wrote:

> hi folk!!
> 
> i'm writing a new library for forms for engineV2. Later it can be
> added to old engine, using
> http://www.aikiframework.org/wiki/Aiki_forms_2 as guidelines.
> 
> In this version form will be encoded as:
> (form(
> {"id":"f_user1", "class": "important", "layout": "p-br"},
> {"type":"text", "name":"username" , "size": "15" , "max-length":"30",
> "placeholder":"your name"},

placeholder should have css/javascript fallback code for not html5
browsers, I can code it after html5 version will be implemented

> {"type":"text", "name":"other","label":"your name, please",
> "tooltip":"separe with ," } ,
> {"type":"radios", "name":"receiv"o", "list": "yes|no|remenber me
no shit like this like in current Aiki fields we should use arrays and
object instead.

"list": {1: "yes", 2: "no", 3: "remenber me later"}

we have datatypes for this in JSON

> later" }, {"type":"select", "name":"group","list": "SQL: SELECT
> id,group_description from groups"}
> )form)

I don't like this one "SQL: SELECT ..." - "SQL: " is
redundant and it's ugly, it should be "list": "SELECT ..." we can
simple tread string as sql and static select need to be object
{"value1": "caption1", "value2": "caption2"}


Recently I made some modifications to spec and put:

"select": "SELECT group_id, group_name FROM table_name"}

but it can be list instead so it will be not confused with type.


> 
> (first {} for forms parameters, and the rest for fields-definition.
> (the code is available in libs/Controls.php)
> 
> In this first version forms will support:
> - forms: retrieving data using a SQL or table,pkey (primary key),
> pkeyfield, { "SQL": "SELECT * FROM clipart LEFT JOIN..."...} or
> { "table": "clipart", "pkey": "122"; "pkeyfield": "clipart_id"...}
> - forms: saving data with { "save": "NAME_OF_SUBMIT" }.. In this case
> if aiki detects the given submit in $_POST, $_GET it save record/add

form syntax should specify method for form sending "method": "POST"

> record (when
> no pkey is given it assumes adding).

I don't like it, it's hidden logic that will be hard for users to
discover by looking at the code. I prefer

(form:add(
(form:delete(
(form:edit(

explicit is better then implicit.

And instead of "save" it should be submit (since it's used in html)

> - controls: text,password, radio, checkbox, select, hidden, textarea,
> submit,reset (all html + html5), plus radios (note -s), with common

why radios it's the type which is single if you want to show that it's
list then you can use "radio[]" but I prefer just radio, since it the
type in Java you don't have type lists but list they are in single.
Every language have type written in single.

> html attributes
> (class, onblur, onchange, placeholder, size, maxlength...)
> - but no fieldset :-(
> 
> The next steps are: expands all type fields, permission, validation,
> pre-process functions.
> 
> I need your help:
> - send me examples of minimal forms, or a list of minimal field type
> that must be implemented.
> - send me examples of desired forms..but can wait for a second
> version.

Simply implement text, password, textarea, select the same that are
in current Aiki.

> 
> Be coherent: a large list of MUST support field requires more time to
> have a first version.
> 
> Roger

--
Jakub Jankiewicz
twitter: @jcubic
www: http://jcubic.pl

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to