#27 enhancement
defel

let TimedObserver check if Form or Element is disabled

Reported by defel | April 18th, 2008 @ 02:38 PM | in 1.7

If I use the Form.Observer or the Form.Element.Observer and I make them disabled, and enable them later, the TimedObserver will overwrite the last value with an empty value, while the Form/Field is disabled.

This is because, if Form-Fields are disabled they don't return any values and I can't edit them, too. So it make no sense to save this (empty) state as the last value in the TimedObserver.

I have changed the Observer to return the last Value if the Element is disabled.

I have tested this patch under linux with FF 2.0.0.11 and Konqueror 3.5.8

Comments and changes to this ticket

  • defel

    defel April 18th, 2008 @ 02:56 PM

    ps.: With this, you can use the following code:

    Form.Observer('my_form', 0.5, function(form, values) {
      form.disable(); 
    			
      new Ajax.Request('/backendAjax.php', {
        method: 'POST', 
        postBody: 'some Post body .. ', 
        onComplete: function(t) {
          // make some foo and enable form again;
          form.enable();  
        }
      }); 
    }
    

    If the Form-Values changed, the form gets disabled, a Ajax.Request is sent (which may took more 0.5 seconds) and the form gets enabled when all things to do are done.

  • Tobie Langel

    Tobie Langel April 18th, 2008 @ 03:10 PM

    • State changed from “new” to “enhancement”
  • John-David Dalton

    John-David Dalton May 29th, 2008 @ 04:25 AM

    • Milestone set to 1.7
  • John-David Dalton

    John-David Dalton May 29th, 2008 @ 04:26 AM

    • Assigned user set to “John-David Dalton”
  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:01 AM

    • Tag set to needs_docs, needs_tests, section:dom

    [not-tagged:"form" tagged:"section:dom" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:25 AM

    • Tag changed from needs_docs, needs_tests, section:dom to missing:documentation, needs_tests, section:dom

    [not-tagged:"needs_docs" tagged:"missing:documentation" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:26 AM

    • Tag changed from missing:documentation, needs_tests, section:dom to missing:documentation, missing:tests, section:dom

    [not-tagged:"needs_tests" tagged:"missing:tests" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:36 AM

    • Tag changed from missing:documentation, missing:tests, section:dom to missing:documentation, needs:tests, section:dom

    [not-tagged:"missing:tests" tagged:"needs:tests" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 03:38 AM

    • Tag changed from missing:documentation, needs:tests, section:dom to needs:doc, needs:tests, section:dom

    [not-tagged:"missing:documentation" tagged:"needs:doc" bulk edit command]

  • T.J. Crowder

    T.J. Crowder November 16th, 2009 @ 04:50 PM

    • Assigned user cleared.

    [responsible:none bulk edit command]

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Attachments

Pages