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

RE: [ydn-javascript] fill form field in a dialog

Expand Messages
  • Steven Peterson
    Martin, Your function needs to be subscribed to the beforeShowEvent. So, you want something like this: var beforeShow = function() { alert( about to show ); };
    Message 1 of 2 , Dec 12, 2006
    • 0 Attachment

      Martin,

       

      Your function needs to be subscribed to the beforeShowEvent. So, you want something like this:

       

      var beforeShow = function() {

         alert(“about to show”);

      };

       

      myDialog.beforeShowEvent.subscribe(beforeShow);

       

      When you do that, your function will fire before your Dialog shows. You can also subscribe multiple handlers to CustomEvents too, so there are a lot of handy things you can do with the hooks we provide you. Please let me know if that resolves things for you.



      Steven Peterson

      Web Developer, Platform Engineering

      Yahoo!

       

       

       

      From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Martin Tschofen
      Sent: Tuesday, December 12, 2006 4:38 PM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] fill form field in a dialog

       

      I'm trying to create a simple dialog that allows the user to change some text. This dialog should be reusable for various text blocks.

       

      I figured I generate a dialog dynamically with a form in it. The only thing in the form will be a textarea containing the text and a submit and cancel button.

       

      My dialog shows up, but I'm stuck on how to get the content of the item I double clicked to populate the textarea. I registered the original div to open the dialog and assumed I could use the beforeShowEvent to fetch the content to display.

       

      The beforeShowEvent never fires. I declared it in the init function:

       var beforeShowEvent = function() {

         alert("about to show");

      };

       

      Perhaps I'm approaching this the wrong way. 

      Any pointers would be appreciated...martin

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