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

Re: [ydn-javascript] Trouble with Dialog

Expand Messages
  • Ken Loomis
    ... I don t know the finer points of YUI. that s for sure, but I use the dialogs a lot. I create the dialog as part of my page rendering. So the appDialog =
    Message 1 of 2 , Aug 28, 2009
    • 0 Attachment
      douloscristou wrote:
      > I am really struggling to wrap my arms around what's going on. I am creating a dialog in my application and not understanding why it is not consistently working as expected. The first time my code runs, everything works correctly. The second time it runs, I cannot move it on the screen (every other attribute seems to be working).
      >
      > The function I am using to create the object follows:
      >
      > appData.createDialog=function(){
      > appData.dialog = new YAHOO.widget.Dialog("dialog", {
      > width : '600px',
      > fixedcenter : true,
      > visible : false,
      > constraintoviewport : true
      > });
      >
      > appData.dialog.render();
      > appData.dialog.show();
      > }
      >
      > Before I call the function, I dynamically create the content for the "dialog" div and then call appData.createDialog();
      I don't know the finer points of YUI. that's for sure, but I use the
      dialogs a lot. I create the dialog as part of my page rendering. So the
      appDialog = new YAHOO.widget.Dialog goes in the init for the page along
      with the appData.dialog.render(). Then when you want to show it, you do
      the appData.dialog.show();

      If you repeatedly call the appDataDialog in your app, you going to be
      creating the same element over and over again, and you would have to
      destroy it each time you closed it, and it would have to be modal to
      prevent you from opening another one while the first is still open. So
      just create and render it once in your page init, and then show it and
      close it as needed.

      HTH

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