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

stringing together dialog widgets and success callback

Expand Messages
  • alexlebek
    Hi, I am not clear on the design for using the container widget to create the behaviour of displaying a dialog which, on successful completion through its
    Message 1 of 5 , Jul 2, 2009
    • 0 Attachment
      Hi,
      I am not clear on the design for using the container widget to create the behaviour of displaying a dialog which, on successful completion through its success callback, will then bring up another dialog primed with information gathered in the first.

      Is it good practice to make an asyncRequest via the connection manager in the success callback - or should this behaviour be achieved some other way?
      I am using google app engine framework (with python) if that matters.

      The specific problem I am having is making the success handshake with the dialog and, in the same server side handler, creating a response for the display of the new dialog. That is why I am wondering if I need to break the step down in the success callback. Hope that makes sense to someone! Any advice welcome.

      Thanks
      Alex
    • Satyen Desai
      Hi Alex, If I understand you correctly, you shouldn t need to dispatch another asyncRequest, specifically to retrieve data for the 2nd Dialog. It would be more
      Message 2 of 5 , Jul 7, 2009
      • 0 Attachment
        Hi Alex,
        If I understand you correctly, you shouldn't need to dispatch another
        asyncRequest, specifically to retrieve data for the 2nd Dialog. It
        would be more efficient to return whatever new data you needed for the
        2nd dialog in your response for the 1st Dialog's async submission.

        I don't have any experience with the particular backend technology
        you're using, but as long as it provides you with the flexibility to
        craft your own response to any particular request, you should be able
        to do it in a single response.

        e.g.

        dialog1.callback.success = function(o) {

        var dataForDialog2 = YAHOO.lang.JSON.parse(o.responseText);

        var dialog2 = new YAHOO.widget.Dialog(...);

        dialog2.setHeader(dataForDialog2.header);
        dialog2.setBody(dataForDialog2.body);

        dialog2.render(document.body);
        dialog2.show();
        }

        Satyen

        On Jul 2, 2009, at 6:30 AM, alexlebek wrote:

        >
        >
        > Hi,
        > I am not clear on the design for using the container widget to
        > create the behaviour of displaying a dialog which, on successful
        > completion through its success callback, will then bring up another
        > dialog primed with information gathered in the first.
        >
        > Is it good practice to make an asyncRequest via the connection
        > manager in the success callback - or should this behaviour be
        > achieved some other way?
        > I am using google app engine framework (with python) if that matters.
        >
        > The specific problem I am having is making the success handshake
        > with the dialog and, in the same server side handler, creating a
        > response for the display of the new dialog. That is why I am
        > wondering if I need to break the step down in the success callback.
        > Hope that makes sense to someone! Any advice welcome.
        >
        > Thanks
        > Alex
        >
        >
        >
      • alexlebek
        Hi Satyen, Thank you for your advice. I feel unsure about the best way to use the back end technology - in this case using django to drive most of the dialog
        Message 3 of 5 , Jul 8, 2009
        • 0 Attachment
          Hi Satyen,

          Thank you for your advice. I feel unsure about the best way to use the back end technology - in this case using django to drive most of the dialog content with yui managing most of the gui bit. Going the suggested route seemed to mean translating between what would have gone in django templates to json format (perhaps these are the same!) and then having to explicitly write the content into the dialog body - rather than through django statements embedded in the html markup. I am not sure yet of the boundaries between these different technologies so some more experimenting is due.

          Thanks again
          Alex



          --- In ydn-javascript@yahoogroups.com, Satyen Desai <sdesai@...> wrote:
          >
          > Hi Alex,
          > If I understand you correctly, you shouldn't need to dispatch another
          > asyncRequest, specifically to retrieve data for the 2nd Dialog. It
          > would be more efficient to return whatever new data you needed for the
          > 2nd dialog in your response for the 1st Dialog's async submission.
          >
          > I don't have any experience with the particular backend technology
          > you're using, but as long as it provides you with the flexibility to
          > craft your own response to any particular request, you should be able
          > to do it in a single response.
          >
          > e.g.
          >
          > dialog1.callback.success = function(o) {
          >
          > var dataForDialog2 = YAHOO.lang.JSON.parse(o.responseText);
          >
          > var dialog2 = new YAHOO.widget.Dialog(...);
          >
          > dialog2.setHeader(dataForDialog2.header);
          > dialog2.setBody(dataForDialog2.body);
          >
          > dialog2.render(document.body);
          > dialog2.show();
          > }
          >
          > Satyen
          >
          > On Jul 2, 2009, at 6:30 AM, alexlebek wrote:
          >
          > >
          > >
          > > Hi,
          > > I am not clear on the design for using the container widget to
          > > create the behaviour of displaying a dialog which, on successful
          > > completion through its success callback, will then bring up another
          > > dialog primed with information gathered in the first.
          > >
          > > Is it good practice to make an asyncRequest via the connection
          > > manager in the success callback - or should this behaviour be
          > > achieved some other way?
          > > I am using google app engine framework (with python) if that matters.
          > >
          > > The specific problem I am having is making the success handshake
          > > with the dialog and, in the same server side handler, creating a
          > > response for the display of the new dialog. That is why I am
          > > wondering if I need to break the step down in the success callback.
          > > Hope that makes sense to someone! Any advice welcome.
          > >
          > > Thanks
          > > Alex
          > >
          > >
          > >
          >
        • Satyen Desai
          Hi, It doesn t necessarily need to be JSON (was just using it to provide a readable example), you can send back HTML for the 2nd dialog and proceed like you re
          Message 4 of 5 , Jul 8, 2009
          • 0 Attachment
            Hi,
            It doesn't necessarily need to be JSON (was just using it to provide a
            readable example), you can send back HTML for the 2nd dialog and
            proceed like you're creating the Dialog from markup once the markup
            has been added to the DOM.

            Regards,
            Satyen

            On Jul 8, 2009, at 4:53 AM, alexlebek wrote:

            >
            >
            > Hi Satyen,
            >
            > Thank you for your advice. I feel unsure about the best way to use
            > the back end technology - in this case using django to drive most of
            > the dialog content with yui managing most of the gui bit. Going the
            > suggested route seemed to mean translating between what would have
            > gone in django templates to json format (perhaps these are the
            > same!) and then having to explicitly write the content into the
            > dialog body - rather than through django statements embedded in the
            > html markup. I am not sure yet of the boundaries between these
            > different technologies so some more experimenting is due.
            >
            > Thanks again
            > Alex
            >
            > --- In ydn-javascript@yahoogroups.com, Satyen Desai <sdesai@...>
            > wrote:
            > >
            > > Hi Alex,
            > > If I understand you correctly, you shouldn't need to dispatch
            > another
            > > asyncRequest, specifically to retrieve data for the 2nd Dialog. It
            > > would be more efficient to return whatever new data you needed for
            > the
            > > 2nd dialog in your response for the 1st Dialog's async submission.
            > >
            > > I don't have any experience with the particular backend technology
            > > you're using, but as long as it provides you with the flexibility to
            > > craft your own response to any particular request, you should be
            > able
            > > to do it in a single response.
            > >
            > > e.g.
            > >
            > > dialog1.callback.success = function(o) {
            > >
            > > var dataForDialog2 = YAHOO.lang.JSON.parse(o.responseText);
            > >
            > > var dialog2 = new YAHOO.widget.Dialog(...);
            > >
            > > dialog2.setHeader(dataForDialog2.header);
            > > dialog2.setBody(dataForDialog2.body);
            > >
            > > dialog2.render(document.body);
            > > dialog2.show();
            > > }
            > >
            > > Satyen
            > >
            > > On Jul 2, 2009, at 6:30 AM, alexlebek wrote:
            > >
            > > >
            > > >
            > > > Hi,
            > > > I am not clear on the design for using the container widget to
            > > > create the behaviour of displaying a dialog which, on successful
            > > > completion through its success callback, will then bring up
            > another
            > > > dialog primed with information gathered in the first.
            > > >
            > > > Is it good practice to make an asyncRequest via the connection
            > > > manager in the success callback - or should this behaviour be
            > > > achieved some other way?
            > > > I am using google app engine framework (with python) if that
            > matters.
            > > >
            > > > The specific problem I am having is making the success handshake
            > > > with the dialog and, in the same server side handler, creating a
            > > > response for the display of the new dialog. That is why I am
            > > > wondering if I need to break the step down in the success
            > callback.
            > > > Hope that makes sense to someone! Any advice welcome.
            > > >
            > > > Thanks
            > > > Alex
            > > >
            > > >
            > > >
            > >
            >
            >
            >
          • alexlebek
            I didn t see that! Thanks! Alex
            Message 5 of 5 , Jul 9, 2009
            • 0 Attachment
              I didn't see that! Thanks! Alex
              --- In ydn-javascript@yahoogroups.com, Satyen Desai <sdesai@...> wrote:
              >
              > Hi,
              > It doesn't necessarily need to be JSON (was just using it to provide a
              > readable example), you can send back HTML for the 2nd dialog and
              > proceed like you're creating the Dialog from markup once the markup
              > has been added to the DOM.
              >
              > Regards,
              > Satyen
              >
              > On Jul 8, 2009, at 4:53 AM, alexlebek wrote:
              >
              > >
              > >
              > > Hi Satyen,
              > >
              > > Thank you for your advice. I feel unsure about the best way to use
              > > the back end technology - in this case using django to drive most of
              > > the dialog content with yui managing most of the gui bit. Going the
              > > suggested route seemed to mean translating between what would have
              > > gone in django templates to json format (perhaps these are the
              > > same!) and then having to explicitly write the content into the
              > > dialog body - rather than through django statements embedded in the
              > > html markup. I am not sure yet of the boundaries between these
              > > different technologies so some more experimenting is due.
              > >
              > > Thanks again
              > > Alex
              > >
              > > --- In ydn-javascript@yahoogroups.com, Satyen Desai <sdesai@>
              > > wrote:
              > > >
              > > > Hi Alex,
              > > > If I understand you correctly, you shouldn't need to dispatch
              > > another
              > > > asyncRequest, specifically to retrieve data for the 2nd Dialog. It
              > > > would be more efficient to return whatever new data you needed for
              > > the
              > > > 2nd dialog in your response for the 1st Dialog's async submission.
              > > >
              > > > I don't have any experience with the particular backend technology
              > > > you're using, but as long as it provides you with the flexibility to
              > > > craft your own response to any particular request, you should be
              > > able
              > > > to do it in a single response.
              > > >
              > > > e.g.
              > > >
              > > > dialog1.callback.success = function(o) {
              > > >
              > > > var dataForDialog2 = YAHOO.lang.JSON.parse(o.responseText);
              > > >
              > > > var dialog2 = new YAHOO.widget.Dialog(...);
              > > >
              > > > dialog2.setHeader(dataForDialog2.header);
              > > > dialog2.setBody(dataForDialog2.body);
              > > >
              > > > dialog2.render(document.body);
              > > > dialog2.show();
              > > > }
              > > >
              > > > Satyen
              > > >
              > > > On Jul 2, 2009, at 6:30 AM, alexlebek wrote:
              > > >
              > > > >
              > > > >
              > > > > Hi,
              > > > > I am not clear on the design for using the container widget to
              > > > > create the behaviour of displaying a dialog which, on successful
              > > > > completion through its success callback, will then bring up
              > > another
              > > > > dialog primed with information gathered in the first.
              > > > >
              > > > > Is it good practice to make an asyncRequest via the connection
              > > > > manager in the success callback - or should this behaviour be
              > > > > achieved some other way?
              > > > > I am using google app engine framework (with python) if that
              > > matters.
              > > > >
              > > > > The specific problem I am having is making the success handshake
              > > > > with the dialog and, in the same server side handler, creating a
              > > > > response for the display of the new dialog. That is why I am
              > > > > wondering if I need to break the step down in the success
              > > callback.
              > > > > Hope that makes sense to someone! Any advice welcome.
              > > > >
              > > > > Thanks
              > > > > Alex
              > > > >
              > > > >
              > > > >
              > > >
              > >
              > >
              > >
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.