[Fwd: Re: [Bese-devel] simple submit sans javascript.]

Drew Crampsie drewc at tech.coop
Tue May 9 22:19:27 UTC 2006


Waldo Rubinstein wrote:
> I think that the exploitation of Ajax all over the place are spoiling 
> the users, who after much work, time, and effort, finally accepted the 
> way browser-based apps worked compared to fat client-server apps.
>
> Now that Ajax has hit the streets and has shown the users how it can 
> disguise the back and forth of the usual browser-based interaction 
> with something more seamless, is just forcing everything to the "pages 
> bloated with javascript".

I agree with this, and use Dojo extensively. But in the case of 
submitting a form, the page reload happens anyway, and the existing 
scheme does, in fact, make it harder to use ajax in certain cases,.

if you look closely at the patch, it changes the way the action 
parameter is processed in the case of multiple inputs. This actually 
makes it easier to use UCW with ajax (at least the way i do it) be 
letting me submit a form from the page, but call a different action 
simply by appending the correct parameter.

Also, there is the accessibility  argument, and the personal pain i 
remember when using Linux 10 years before everybody else.. alternate 
browsers and all that.

>
>
> At least this has been my experience with my customers. I don't 
> develop for public users. All my applications are for internal 
> purposes, intranet-like apps. So that "fat client-server"-like 
> experience is not only appreciated, but now is being demanded.

I didn't say anything about throwing away the baby with the bathwater 
:). I use Dojo a lot.. but never simply to submit a form. I also have an 
application that uses prototype, and an older version at that. loading 
Dojo clobbers it. i try to keep these things up to date with the latest 
ucw, as hard as that is.
>
>
> I don't see the "big deal" in requiring it in UCW apps. Once of the 
> things about Dojo compared to the rest is it's packaging system which 
> will let you minimize the initial amount of javascript hat you need to 
> load and then just load what you need more if you have to.
Dojo is great, so is lynx, cell-phone browsers, etc etc. Why require 
something that is not needed, and breaks in some environments?

just my $0.02CAD

drewc
>
>
> - Waldo
>
> On May 9, 2006, at 3:15 PM, Drew Crampsie wrote:
>
>> Imagine my surprise when, after updating to ucw_dev, ALL my 
>> application stopped working!
>>
>> The culprit? forms now require dojo to work. I like dojo as much as 
>> the next guy, but i rarely initially develop in an environment where 
>> it is available.
>>
>> To tell you the truth, i've never much liked the fact that forms used 
>> Javascript to begin with, but lived with it until now :)
>>
>> anyways, patchy patchy applied to ucw_public and attached. 
>> Personally, i think that SIMPLE-FORMS should become the default, and 
>> the complex, bulky, page-bloating javascript producing forms should 
>> be used only if the user specifically wants them.
>>
>> Thoughts?
>>
>> drewc
>>
>> Sun May 7 00:36:02 BST 2006 Drew Crampsie <drewc at tech.coop>
>> * Add a <ucw:simple-submit and <ucw:simple-form that do not require 
>> javascript.
>>
>> <ucw:simple-submit uses a BUTTON tag to render a submit button that 
>> does not require javascript
>>
>> To make this happen, i added a method to find-action that operates on 
>> a list,
>> grabbing the car and using it as the action id. When a form is 
>> submitted with an extra action parameter,
>> the last one submitted (first in the list) is taken to be the action-id.
>>
>> This allows forms without javascript!! SIMPLE-SUBMIT will work in the 
>> standard UCW:FORM,
>> SIMPLE-FORM is a form without the JS cruft, but will not work with 
>> standard <UCW:* submit buttons.
>>
>>
>>
>>
>> New patches:
>>
>> [Add a <ucw:simple-submit and <ucw:simple-form that do not require 
>> javascript.
>> Drew Crampsie <drewc at tech.coop>**20060506233602
>>
>>  <ucw:simple-submit uses a BUTTON tag to render a submit button that 
>> does not require javascript
>>
>>  To make this happen, i added a method to find-action that operates 
>> on a list,
>>  grabbing the car and using it as the action id. When a form is 
>> submitted with an extra action parameter,
>>  the last one submitted (first in the list) is taken to be the 
>> action-id.
>>
>>  This allows forms without javascript!! SIMPLE-SUBMIT will work in 
>> the standard UCW:FORM,
>>  SIMPLE-FORM is a form without the JS cruft, but will not work with 
>> standard <UCW:* submit buttons.
>>
>>
>>
>> ] {
>> hunk ./src/packages.lisp 317
>> +   #:simple-form
>> +   #:simple-submit
>> hunk ./src/rerl/standard-session-frame.lisp 12
>> +
>> +(defmethod find-action ((f standard-session-frame) (action-id list))
>> +  (find-action f (car action-id)))
>> +
>> +(defmethod (setf find-action) (lambda (f standard-session-frame) 
>> (action-id string))
>> +  (setf (gethash action-id (frame.actions f))
>> +    lambda))
>> hunk ./src/yaclml/ucw-tags.lisp 39
>> +(deftag-macro <ucw:simple-form (&attribute (id 
>> '(js:gen-js-name-string :prefix "ucw-form"))
>> +                        action
>> +                        &allow-other-attributes others
>> +                        &body body)
>> +  "A Simple form tag, made for use with SIMPLE-SUBMIT. Does not 
>> require javascript."
>> +  (with-unique-names (url query action-id)
>> +    (rebinding (id)
>> +      `(let* ((,action-id (make-new-action (context.current-frame 
>> *context*)
>> +                       (lambda () (with-call/cc ,action))))
>> +              (,url (compute-url *current-component*
>> +                                 :action-id ,action-id)))
>> +         (<:form :action (print-uri-to-string-sans-query ,url)
>> +                 , at others
>> +         (dolist (,query (uri.query ,url))
>> +           (if (string= ,+action-parameter-name+ (car ,query))
>> +               (<:input :type "hidden" :name ,+action-parameter-name+
>> +                :value (when ,action (cdr ,query))
>> +                :id ,action-id)
>> +               (<:input :type "hidden" :name (car ,query) :value 
>> (cdr ,query))))
>> +         , at body)))))
>> +
>> +(deftag-macro <ucw:simple-submit (&attribute action 
>> &allow-other-attributes others &body body)
>> +  "Presents an button tag which executes ACTION when clicked."
>> +  `(<:button :type "submit"
>> +         :name +action-parameter-name+
>> +         :value (make-new-action (context.current-frame *context*)
>> +                     (lambda () (with-call/cc ,action)))
>> +         , at others , at body))
>> +
>> +
>> }
>>
>> Context:
>>
>> [Added send-redirect function.
>> Marco Baringer <mb at bese.it>**20060501154250
>>
>>  send-redirect does what redirect-component's render method did but
>>  it's usable from a simple-dispatcher (or anywhere else we don't have
>>  ucw's component context machinery).
>> ]
>> [Use dolist*, not dolist, in tabbed-pane's render method.
>> Marco Baringer <mb at bese.it>**20060501135314]
>> [Using (when (whatever) T) is weird, use (whatever) instead
>> Marco Baringer <mb at bese.it>**20060501135000]
>> [Minor indentation/whitespace fixups in src/components/form.lisp
>> Marco Baringer <mb at bese.it>**20060501134849]
>> [make-with-dummy-request-nicer
>> cjstuij at gmail.com**20060501001756]
>> [tabbed-pane-makeover - tabbed panes are now wrapped in divs in stead 
>> of a table, for more design flexibility. Is no longer tied to a tal 
>> file.
>> cjstuij at gmail.com**20060430233920]
>> [Removing integer-range-validator, use number-range-validator instead.
>> Nathan Bird <nathan at acceleration.net>**20060428165829]
>> [the value of a number-field should be nil, not 0, if nothing was 
>> entered.
>> Nathan Bird <nathan at acceleration.net>**20060428164949]
>> [bin/ucwctl: allow a custom ucwctl.conf via -u|--ucwctl-file
>> Luca Capello <luca at pca.it>**20060501110031
>>
>>  This adds the possibility to specify a different ucwctl.conf file
>>  instead of the default /etc/ucw/ucwctl.conf.  Moreover, by default
>>  ucwctl now reads ~/.ucw/ucwctl.conf it it exists, overriding the
>>  values in the general /etc/ucw/ucwctl.conf, and the same happens if
>>  the ucwctl.conf is specified via the command line option.  All command
>>  line options override the values present in any ucwctl.conf files.
>>  The order is the following:
>>
>>    1) /etc/ucw/ucwctl.conf (if it exists)
>>    2) ~/.ucw/ucwctl.conf (if it exists)
>>    3) -u|--ucwctl-file (if specified, exit if it cannot be read)
>>    4) command line options
>>
>>  A deeper discussion is available at:
>>
>>    http://common-lisp.net/pipermail/bese-devel/2006-April/001932.html
>>    http://common-lisp.net/pipermail/bese-devel/2006-April/001961.html
>> ]
>> [In the phone and email validators instead of defining a new slot we 
>> just use the :default-initargs class option
>> Marco Baringer <mb at bese.it>**20060428103114]
>> [Adding documentation to form.lisp
>> Nathan Bird <nathan at acceleration.net>**20060428023256]
>> [Rearranging file contents to reduce style-warnings
>> Nathan Bird <nathan at acceleration.net>**20060428022511]
>> [Implementing value-validators
>> Nathan Bird <nathan at acceleration.net>**20060428020403
>>  Value-validators are a category of validators that are only applied 
>> if there
>>  is actually a value. This was done to provide a more systematic 
>> scheme since
>>  there were several different ways it was being handled previously.
>>  Javascript validation in this patch is untested.
>> ]
>> [Expanded the forms example to include a number-field and 
>> number-range-validated field.
>> Nathan Bird <nathan at acceleration.net>**20060428014551]
>> [added a standard regular exprexpression validator then made 
>> e-mail-validator use it.  E-mail-validator IS NO LONGER INVALID IF 
>> EMPTY. Adde d an international phonenumber validator
>> russ at acceleration.net**20060425154947]
>> [added regex exports
>> russ at acceleration.net**20060424225714]
>> [Comment fixup
>> Nathan Bird <nathan at acceleration.net>**20060427173259]
>> [Added missing id param that got lost in my <ucw:form changes
>> attila.lendvai at gmail.com**20060424150549]
>> [TAG 2006-04-25
>> Marco Baringer <mb at bese.it>**20060425145623]
>> Patch bundle hash:
>> 35fa34a9ac934fdd8cafa9b7992c7e5aaf03ab8a
>> _______________________________________________
>> bese-devel mailing list
>> bese-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel
>





More information about the bese-devel mailing list