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

Autocomplete events not firing in a Dialog?

Expand Messages
  • Gatchaman_98
    I have a YUI Dialog which is supposed to contain a YUI Autocompleter. But for some reason, it seems like none of the Autocompleter events are firing. Can
    Message 1 of 3 , Aug 2 10:55 AM
    • 0 Attachment
      I have a YUI Dialog which is supposed to contain a YUI Autocompleter.
      But for some reason, it seems like none of the Autocompleter events
      are firing. Can anyone point me in the right direction, to figure out
      why the events are not firing, and how I can fix this?

      The individual components work fine on their own. That is, if I just
      have a Dialog (turning off the Autocomplete Javascript), that part
      works fine. If I turn off the Dialog and just use a straight form,
      everything in the Autocompleter works fine -- it calls the function to
      get the choices, populates the list, and accepts my choice.

      I've put some debug lines in the autocomplete-debug.js, such as:
      YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) {
      YAHOO.log("On key up?","info",this.toString());
      ...
      }

      I never see these Debugs when using the Dialog, so it seems like the
      Dialog is somehow making the events not happen.

      I've searched the group but don't see anyone else having this problem.

      I have this code in my jsp:
      <a href="javascript: tagDialog.show();">Add your tag.</a><br/>
      <div id="tagDialog">
      <form name="addTagForm" id="addTagForm" action="">
      <b>Enter your own tag</b>
      <div id="tagsautocomplete">
      <input type="text" name="newTag" id="newTag"/>
      <div id="tagChoices"></div>
      </div>
      </form>
      </div>

      <script type="text/javascript">
      var choicesDS = new
      YAHOO.widget.DS_JSFunction(ContentManager.getTagChoices);
      var tagAutoComp = new YAHOO.widget.AutoComplete('newTag','tagChoices',
      choicesDS);
      </script>
    • Alexx Alexx
      I met the same problem when tried to use Drag&Drop inside Dialog. The suggested workaround was to call Render method of Drag-n-Drop Object AFTER rendering the
      Message 2 of 3 , Aug 2 1:14 PM
      • 0 Attachment
        I met the same problem when tried to use Drag&Drop
        inside Dialog. The suggested workaround was to call
        Render method of Drag-n-Drop Object AFTER rendering
        the Dialog... I think you should do the same!
        It doesnt work because Dialog use innerHTML assigning
        in setBody function, that removes all attached
        listeners from Content in the body.

        Perhaps this should be clarified in Docs for YUI since
        we are not alone who met this, I suppose!

        ----------------
        Best regards,
        Alexander

        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com
      • Gatchaman_98
        Awesome! Thanks very much. I put the AutoComplete initializing code after the render method for the Dialog, and everything works as expected. Thanks again.
        Message 3 of 3 , Aug 2 2:43 PM
        • 0 Attachment
          Awesome! Thanks very much. I put the AutoComplete initializing code
          after the render method for the Dialog, and everything works as
          expected. Thanks again.
        Your message has been successfully submitted and would be delivered to recipients shortly.