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

IE problem with Event.generateID

Expand Messages
  • Mattias Thorslund
    Hi, Sorry if this has been up already, I just joined the list. I m using the Event functionality in order to add some effects to my form fields (change
    Message 1 of 6 , Jan 26, 2007
    • 0 Attachment
      Hi,

      Sorry if this has been up already, I just joined the list.

      I'm using the Event functionality in order to add some effects to my
      form fields (change background color of the field that is in focus,
      change the border if fields with unsaved changes), and it all works
      great in Firefox. In both IE 6 and IE 7, I get an error on line 1184 in
      event.js: "object does not support this property or method".

      That is in the Event.generateID() method, and the line in question is
      where the element is assigned a new random "id". Is that property
      perhaps read-only in IE? Any suggestions for a workaround (other than
      manually assigning an ID to each field)?

      Thanks for any suggestions,

      Mattias
    • Eric Miraglia
      Mattias, You might be able to make the problem go away by deferring your logic until the window s load event has fired, but that s just a guess. Please try
      Message 2 of 6 , Jan 30, 2007
      • 0 Attachment
        Mattias,

        You might be able to make the problem go away by deferring your logic until the window's load event has fired, but that's just a guess.  Please try posting a working URL -- there are some great developers out there on this list, and if one of them has time to check out what you're doing you might get your question answered that way.

        Regards,
        Eric

        ______________________________________________
        Eric Miraglia
        Yahoo! User Interface Library



        On Jan 26, 2007, at 1:35 PM, Mattias Thorslund wrote:

        Hi,

        Sorry if this has been up already, I just joined the list.

        I'm using the Event functionality in order to add some effects to my
        form fields (change background color of the field that is in focus,
        change the border if fields with unsaved changes), and it all works
        great in Firefox. In both IE 6 and IE 7, I get an error on line 1184 in
        event.js: "object does not support this property or method".

        That is in the Event.generateID() method, and the line in question is
        where the element is assigned a new random "id". Is that property
        perhaps read-only in IE? Any suggestions for a workaround (other than
        manually assigning an ID to each field)?

        Thanks for any suggestions,

        Mattias


      • Michael Winston
        Let s say I have 1000 different nodes and each one could have a custom contextual menu (using YUI Menu, of course). I m a little worried about the performance
        Message 3 of 6 , Jan 30, 2007
        • 0 Attachment
          Let's say I have 1000 different nodes and each one could have a
          custom contextual menu (using YUI Menu, of course). I'm a little
          worried about the performance efficiency of building 1000 individual
          contextmenus (lazyloaded or not) on the chance a user might actually
          want to use one or two of them. This is especially true since some
          number of the menus might need to be built with AJAX calls.

          So what I'd like to do is just attach an 'oncontextmenu' listener to
          those 1000 nodes that will dynamically build, render, and override
          the browser's contextmenu.

          Is this possible and, if so, how?
          If not, it would be great to know that it's impossible.

          Thanks,
          Michael
        • Todd Kloots
          Michael - If you set the lazyload configuration property to true for your ContextMenu, then its contents will not get created and the menu itself will not
          Message 4 of 6 , Jan 30, 2007
          • 0 Attachment
            Michael -

            If you set the "lazyload" configuration property to
            "true" for your ContextMenu, then its contents will
            not get created and the menu itself will not be
            rendered until the "contextmenu" event is actually
            fired.

            That said, if you're creating a ~1000 elements with
            unique context menus, then, yes it would be better to
            reuse a single ContextMenu instance and reuse it. You
            can subscribe to your context menu's "showEvent" and
            use the "contextEventTarget" to determine what child
            node was the actual target of the "contextmenu" event
            that triggered the display of the menu. You can then
            use that target element to determine what content you
            need to add or remove from the menu.

            Make sense?

            - Todd



            --- Michael Winston <michaelw@...> wrote:

            > Let's say I have 1000 different nodes and each one
            > could have a
            > custom contextual menu (using YUI Menu, of course).
            > I'm a little
            > worried about the performance efficiency of building
            > 1000 individual
            > contextmenus (lazyloaded or not) on the chance a
            > user might actually
            > want to use one or two of them. This is especially
            > true since some
            > number of the menus might need to be built with AJAX
            > calls.
            >
            > So what I'd like to do is just attach an
            > 'oncontextmenu' listener to
            > those 1000 nodes that will dynamically build,
            > render, and override
            > the browser's contextmenu.
            >
            > Is this possible and, if so, how?
            > If not, it would be great to know that it's
            > impossible.
            >
            > Thanks,
            > Michael
            >
            >
            >
            > Yahoo! Groups Links
            >
            > (Yahoo! ID required)
            >
            > mailto:ydn-javascript-fullfeatured@yahoogroups.com
            >
            >
            >
            >
            >
            >
          • Kenny
            Todd - I have a similar scenario, but the content is available as markup. Below mentioned approach holds good or is there any finest approach ?!. Please
            Message 5 of 6 , Jan 31, 2007
            • 0 Attachment
              Todd -

              I have a similar scenario, but the content is available as markup.
              Below mentioned approach holds good or is there any finest approach ?!.

              Please advice.

              Thanks,
              Kenny


              Todd Kloots <kloots@...> wrote:
              Michael -

              If you set the "lazyload" configuration property to
              "true" for your ContextMenu, then its contents will
              not get created and the menu itself will not be
              rendered until the "contextmenu" event is actually
              fired.

              That said, if you're creating a ~1000 elements with
              unique context menus, then, yes it would be better to
              reuse a single ContextMenu instance and reuse it. You
              can subscribe to your context menu's "showEvent" and
              use the "contextEventTarget " to determine what child
              node was the actual target of the "contextmenu" event
              that triggered the display of the menu. You can then
              use that target element to determine what content you
              need to add or remove from the menu.

              Make sense?

              - Todd

              --- Michael Winston <michaelw@darkhorse. com> wrote:

              > Let's say I have 1000 different nodes and each one
              > could have a
              > custom contextual menu (using YUI Menu, of course).
              > I'm a little
              > worried about the performance efficiency of building
              > 1000 individual
              > contextmenus (lazyloaded or not) on the chance a
              > user might actually
              > want to use one or two of them. This is especially
              > true since some
              > number of the menus might need to be built with AJAX
              > calls.
              >
              > So what I'd like to do is just attach an
              > 'oncontextmenu' listener to
              > those 1000 nodes that will dynamically build,
              > render, and override
              > the browser's contextmenu.
              >
              > Is this possible and, if so, how?
              > If not, it would be great to know that it's
              > impossible.
              >
              > Thanks,
              > Michael
              >
              >
              >
              > Yahoo! Groups Links
              >
              > (Yahoo! ID required)
              >
              > mailto:ydn-javascript- fullfeatured@ yahoogroups. com
              >
              >
              >
              >
              >
              >



              Never miss an email again!
              Yahoo! Toolbar
              alerts you the instant new Mail arrives. Check it out.

            • Michael Winston
              That makes perfect sense and is an absolutely terrific solution. I always forget that I can subscribe to those interesting moments . Thanks! Michael
              Message 6 of 6 , Jan 31, 2007
              • 0 Attachment
                That makes perfect sense and is an absolutely terrific solution.  I always forget that I can subscribe to those "interesting moments".

                Thanks!
                Michael

                On Jan 30, 2007, at 11:54 AM, Todd Kloots wrote:

                Michael -

                If you set the "lazyload" configuration property to
                "true" for your ContextMenu, then its contents will
                not get created and the menu itself will not be
                rendered until the "contextmenu" event is actually
                fired.

                That said, if you're creating a ~1000 elements with
                unique context menus, then, yes it would be better to
                reuse a single ContextMenu instance and reuse it. You
                can subscribe to your context menu's "showEvent" and
                use the "contextEventTarget" to determine what child
                node was the actual target of the "contextmenu" event
                that triggered the display of the menu. You can then
                use that target element to determine what content you
                need to add or remove from the menu.

                Make sense?

                - Todd

                --- Michael Winston <michaelw@darkhorse.com> wrote:

                > Let's say I have 1000 different nodes and each one
                > could have a
                > custom contextual menu (using YUI Menu, of course).
                > I'm a little
                > worried about the performance efficiency of building
                > 1000 individual
                > contextmenus (lazyloaded or not) on the chance a
                > user might actually
                > want to use one or two of them. This is especially
                > true since some
                > number of the menus might need to be built with AJAX
                > calls.
                >
                > So what I'd like to do is just attach an
                > 'oncontextmenu' listener to
                > those 1000 nodes that will dynamically build,
                > render, and override
                > the browser's contextmenu.
                >
                > Is this possible and, if so, how?
                > If not, it would be great to know that it's
                > impossible.


              Your message has been successfully submitted and would be delivered to recipients shortly.