Loading ...
Sorry, an error occurred while loading the content.
 

RE: [ydn-javascript] Cannot define Dialog div inside a tag

Expand Messages
  • Steven Peterson
    Alex, If you don t need to use the Dialog features (the built-in form, for instance), would it make more sense for you to just work with a Panel that s
    Message 1 of 11 , Nov 1, 2006

      Alex,

       

      If you don’t need to use the Dialog features (the built-in form, for instance), would it make more sense for you to just work with a Panel that’s contained within the form? Which features of Dialog are you using that are unavailable as a part of Panel?

       

      Thanks!

       

      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!

       

       

       

      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
      Sent: Wednesday, November 01, 2006 9:53 AM
      To: ydn-javascript@yahoogroups.com
      Subject: Re: [ydn-javascript] Cannot define Dialog div inside a <form> tag

       

      Hi Steven,

      Just like Bart mentioned, placing the dialog in a div at the
      document.body level does not work in this case. I would like the
      dialog markup to stay inside my form, because the dialog has form
      controls, which need to be inside my form.

      I am well aware that this interferes with the ability of the dialog to
      submit data to the server on its own, but for the use case I have
      here, this is an ability that I don't need. I just want a great dialog
      :). So in the meantime, I will keep the "return;" inserted as the
      first statement of registerForm().

      Alex

      On 10/13/06, Steven Peterson <peterson@...> wrote:

      >
      >
      >
      >
      > Alex,
      >
      >
      >
      > Like I suggested to Scott, Dialog generally should not be rendered nested
      in another element if at all possible. You can achieve this by calling render with document.body as an argument. In that case, the Dialog will be rendered outside of the default ASP.NET form, so you shouldn't encounter this issue. The initial placement of the markup is not important, but the final place where the Dialog ends up is significant. The form currently cannot be disabled because it is relied upon by the Dialog as a container for the form elements that will ultimately be submitted to the server. However, if the markup is placed correctly, the coexistence of two forms on your page should not be a problem. It would be great if you could let me know if the render argument solves your issue, so that I'll be able to recommend it to people in the future if they encounter this issue in the future.
      >
      >
      >
      > Thanks!
      >
      > Steven Peterson
      >
      > Web Developer, Platform Engineering
      >
      > Yahoo!
      >
      >
      >
      >
      >
      >
      >
      > From: ydn-javascript@yahoogroups.com
      [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Alessandro Vernet
      > Sent: Friday, October 13, 2006 6:11 PM
      > To: ydn-javascript@yahoogroups.com
      > Subject: Re: [ydn-javascript] Cannot define Dialog div inside a
      <form> tag
      >
      >
      >
      >
      >
      >
      >
      > Steven,
      >
      > I have the same problem as Scott: I need the dialog to be inside an
      > existing form in the page, and I don't need the library to create its
      > own form. So for now I just added a "return;" at the beginning
      of
      > registerForm(), but it would be useful to be able to disable this
      > feature, if it is not needed.
      >
      > Alex
      >
      > On 10/9/06, Steven Peterson <peterson@...>
      wrote:
      > >
      > >
      > >
      > >
      > > Scott,
      > >
      > >
      > >
      > > You can define your Dialog anywhere that you would like to. The key
      is where you decide to render it. Your best bet is to call myDialog.render(document.body) so that the markup is initially rendered within your form, but is allowed to escape the form when the render method is called. It's generally best to render your Dialogs to the body anyway, because then you are guaranteed that your z-index will always supercede any other absolutely or relatively positioned elements in the page. Try that one-line fix and let me know how it works for you.
      > >
      > >
      > >
      > > Thanks!
      > >
      > > Steven Peterson
      > >
      > > Web Developer, Platform Engineering
      > >
      > > Yahoo!
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > >
      > > From: ydn-javascript@yahoogroups.com
      [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Scott Rankin
      > > Sent: Friday, October 06, 2006 2:29 PM
      > > To: ydn-javascript@yahoogroups.com
      > > Subject: [ydn-javascript] Cannot define Dialog div inside a
      <form> tag
      > >
      > >
      > >
      > >
      > >
      > >
      > > Hello,
      > >
      > > I'm trying to make part of my HTML form a dialog that pops up instead
      > > of a series of textboxes on a page. However, when I load the page
      > > with the dialog's DIV declared inside the <form> tag, I get an
      error
      > > saying "form has no properties" on container.js line 3234
      (this is
      > > 0.11.4). If I move the dialog's DIV outside, it works, but then my
      > > inputs that are on the dialog no longer get submitted when my main
      > > page is submitted.
      > >
      > > This is easily reproducible with the dialog.html example page shipped
      > > with yui.zip - just simply add a <form> element right inside
      the
      > > <body> tag and reload the page - you'll get a JavaScript error.
      > >
      > > Is this misuing the library? It seems that it would be quite powerful
      > > to be able to expose parts of your form in a dialog rather than
      inline
      > > on the page, but still have only one main page form submit to worry
      > > about...
      > >
      > > Thanks,
      > >
      > > Scott
      > >
      > >
      >
      > --
      > Blog (XML, Web apps, Open Source):
      > http://www.orbeon.com/blog/
      >
      >
      >
      >

      --
      Blog (XML, Web apps, Open Source):
      http://www.orbeon.com/blog/

    • steve.klee
      I previously posted a solution to using the Dialog embedded in an ASP.NET form. Admittedly I hacked up the YUI source but this would be easy to modify as your
      Message 2 of 11 , Nov 1, 2006
        I previously posted a solution to using the Dialog embedded in an
        ASP.NET form. Admittedly I hacked up the YUI source but this would be
        easy to modify as your own sub-classed Dialog object. The link to the
        previous post is here:

        http://tech.groups.yahoo.com/group/ydn-javascript/message/4902

        It allows you to tell the Dialog to use the ASP.NET form and also
        let's you specify the first and last form element as the built-in
        dialog does not consider anchors in its own evaluation.
      Your message has been successfully submitted and would be delivered to recipients shortly.