[Nitro] Fwd: [ nitro-Bugs-3556 ] part/admin does not respond well to array controls

zimba.tm zimba.tm at gmail.com
Thu Feb 16 12:06:31 EST 2006


Hi Bryan,

is it possible to give me a patch which is in sync with my own repo ? I don't 
have much time to look after that piece of code but it looks good.

On Wednesday 15 February 2006 22:28, Bryan Soto wrote:
> Not quite an RSS feed. :/
>
> zimbu, Chris, what do you think? I believe you guys did some work on the
> controls?
>
> bryan
>
> ---------- Forwarded message ----------
> From: noreply at rubyforge.org <noreply at rubyforge.org>
> Date: Feb 13, 2006 5:02 PM
> Subject: [ nitro-Bugs-3556 ] part/admin does not respond well to array
> controls
> To: noreply at rubyforge.org
>
> Bugs item #3556, was opened at 2006-02-13 20:02
> You can respond by visiting:
> http://rubyforge.org/tracker/?func=detail&atid=1670&aid=3556&group_id=418
>
> Category: Nitro
> Group: None
> Status: Open
> Resolution: None
> Priority: 3
> Submitted By: Nobody (None)
> Assigned to: Nobody (None)
> Summary: part/admin does not respond well to array controls
>
> Initial Comment:
> Steps to reproduce:
>
> 1. Create a model which has an Array property
> 2. Require 'nitro', 'og' and 'part/admin'
> 3. Start your web server
> 4. Go to the /admin and click on your model
> 5. Try to create a new instance of your model class, and you should get
> this error:
>
> undefined local variable or method `emit_container_start' for
> #<Nitro::ArrayControl:0x1698b38>
>
> /usr/local/lib/ruby/gems/1.8/gems/nitro-0.28.0/lib/nitro/helper/form/contro
>ls.rb:170:in `render'
>
>
> Patch to fix might be (someone needs to sanity check)
>
> ---
> /usr/local/lib/ruby/gems/1.8/gems/nitro-0.28.0/lib/nitro/helper/form/contro
>ls.rb 2006-02-14
> 11:55:21.000000000 +1100
> +++ -   2006-02-14 12:05:57.000000000 +1100
> @@ -192,6 +192,14 @@
>      }
>    end
>
> +  def emit_container_start
> +    %{<div class="array_container">}
> +  end
> +
> +  def emit_container_end
> +    %{</div>}
> +  end
> +
>    def emit_js
>      %{
>        <script type="text/javascript">
> @@ -218,7 +218,7 @@
>            node.getElementsByTagName
> ('input')[0].removeAttribute('disabled');
>            if(container.lastChild==ctl) container.appendChild(node);
>            else container.insertBefore(node, ctl.nextSibling);
> -          if(container.childNodes.length>1) container.getElementsByTagName
> ('input')[0].disabled='';
> +          if(container.childNodes.length>1) container.getElementsByTagName
> ('input')[1].disabled='';
>          }
>        </script>
>      }
>
> The second part of the patch is because the remove array element button
> didn't activate due to the off by one error.
>
>
> ----------------------------------------------------------------------
>
> You can respond by visiting:
> http://rubyforge.org/tracker/?func=detail&atid=1670&aid=3556&group_id=418

-- 
Cheers,
  zimba.tm

weblog : http://zimba.oree.ch



More information about the Nitro-general mailing list