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

Re: [ydn-javascript] set url dynamically for a menu item

Expand Messages
  • Todd Kloots
    Priya - Every MenuItem instance has a url configuration property that you can use. The property is documented here:
    Message 1 of 10 , Aug 1, 2006
    • 0 Attachment
      Priya -

      Every MenuItem instance has a "url" configuration
      property that you can use. The property is documented
      here:

      http://developer.yahoo.com/yui/menu/#mitemconfigref

      General info on using configuration properties is
      available here:

      http://developer.yahoo.com/yui/menu/#configurationproperties

      - Todd


      --- priya_806 <priya_806@...> wrote:

      > Hi
      >
      > Is there any method, that we can set the url
      > dynamically for a
      > menuitem??
      >
      > Priya
      >
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      > ydn-javascript-unsubscribe@yahoogroups.com
      >
      >
      >
      >
      >
      >
      >
    • priya_806
      Hi I need to display the photos as shown in the Photo Box example, but in example, the url of photos are hardcoded... my question is how can we set the url of
      Message 2 of 10 , Aug 1, 2006
      • 0 Attachment
        Hi

        I need to display the photos as shown in the Photo Box example,
        but in example, the url of photos are hardcoded...

        my question is how can we set the url of photos dynamically,which
        picks the photo from database depending on the photoid?

        Any suggestions please

        Thanks
        Priya
      • Levan Dvalishvili
        For Dialog Obj I want to pass parameters to functions that listen to built in button click actions Example : var myButtons = [ { text: Submit ,
        Message 3 of 10 , Aug 1, 2006
        • 0 Attachment

          For Dialog Obj I want to pass parameters to functions  that listen to  built in button click actions

           

          Example :

          var myButtons = [ { text:"Submit", handler:this.filterDialogContainer.handleSubmit, isDefault:true }, { text:"reset to Default", handler:this.filterDialogContainer.handleDefault },

                        { text:"Cancel", handler:this.filterDialogContainer.handleCancel } ];

           

           

          I want to pass a parent object as parameter to handleSubmit function, since inside the function soce changes to dialog itself, how would I do that? Is it possible

          Something similar as it’s  done with event handler subscription :

          this.filterDialogContainer.dialog.manualSubmitEvent.subscribe(this.filterDialogContainer.handleManual, this, true);

           

          or maybe I have to tell it to adjust scope and give me this to be the parent object of the function that handles that buttons click?

           

           

          Best Regards.

        • Steven Peterson
          Priya, The PhotoBox is only a simple example. You can modify the code to make them dynamic in whatever way you d like, but that functionality isn t built
          Message 4 of 10 , Aug 1, 2006
          • 0 Attachment

            Priya,

             

            The PhotoBox is only a simple example. You can modify the code to make them dynamic in whatever way you’d like, but that functionality isn’t built directly into the class. If you create a more complex version of PhotoBox, please feel free to share it with the community!

             

            Thanks!

            Steven Peterson

            Web Developer, Platform Engineering

            Yahoo!

             

             

             

            From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of priya_806
            Sent: Tuesday, August 01, 2006 2:22 PM
            To: ydn-javascript@yahoogroups.com
            Subject: [ydn-javascript] photo box

             

            Hi

            I need to display the photos as shown in the Photo Box example,
            but in example, the url of photos are hardcoded...

            my question is how can we set the url of photos dynamically,which
            picks the photo from database depending on the photoid?

            Any suggestions please

            Thanks
            Priya

          • Steven Peterson
            The easiest way to do this is to use a closure, as in: var myObj = x ; var handleSubmit = function() { alert(myObj); } If you do this, you can pass any object
            Message 5 of 10 , Aug 1, 2006
            • 0 Attachment

              The easiest way to do this is to use a closure, as in:

               

              var myObj = “x”;

               

              var handleSubmit = function() {

                    alert(myObj);

              }

               

              If you do this, you can pass any object you’d like to the handlers.

               

              Steven Peterson

              Web Developer, Platform Engineering

              Yahoo!

               

               

              From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Levan Dvalishvili
              Sent: Tuesday, August 01, 2006 3:14 PM
              To: ydn-javascript@yahoogroups.com
              Subject: [ydn-javascript] Dialog Buttons , how to pass parameters to their handlers?

               

              For Dialog Obj I want to pass parameters to functions  that listen to  built in button click actions

               

              Example :

              var myButtons = [ { text:"Submit", handler:this.filterDialogContainer.handleSubmit, isDefault:true }, { text:"reset to Default", handler:this.filterDialogContainer.handleDefault },

                            { text:"Cancel", handler:this.filterDialogContainer.handleCancel } ];

               

               

              I want to pass a parent object as parameter to handleSubmit function, since inside the function soce changes to dialog itself, how would I do that? Is it possible

              Something similar as it’s  done with event handler subscription :

              this.filterDialogContainer.dialog.manualSubmitEvent.subscribe(this.filterDialogContainer.handleManual, this, true);

               

              or maybe I have to tell it to adjust scope and give me this to be the parent object of the function that handles that buttons click?

               

               

              Best Regards.

            • sandysubha
              I just changed the static url in the photos:[{src: Sample.s?id= + id,caption:title}] now its working in firefox....but not in IE?? Any suggestions please to
              Message 6 of 10 , Aug 2, 2006
              • 0 Attachment
                I just changed the static url in the

                photos:[{src:"Sample.s?id="+ id,caption:title}]

                now its working in firefox....but not in IE??

                Any suggestions please to make photobox working in IE??

                Thanks
                Priya
                --- In ydn-javascript@yahoogroups.com, "Steven Peterson"
                <peterson@...> wrote:
                >
                > Priya,
                >
                >
                >
                > The PhotoBox is only a simple example. You can modify the code to
                make them
                > dynamic in whatever way you'd like, but that functionality isn't
                built
                > directly into the class. If you create a more complex version of
                PhotoBox,
                > please feel free to share it with the community!
                >
                >
                >
                > Thanks!
                >
                > Steven Peterson
                >
                > Web Developer, Platform Engineering
                >
                > Yahoo!
                >
                >
                >
                >
                >
                >
                >
                > From: ydn-javascript@yahoogroups.com [mailto:ydn-
                javascript@yahoogroups.com]
                > On Behalf Of priya_806
                > Sent: Tuesday, August 01, 2006 2:22 PM
                > To: ydn-javascript@yahoogroups.com
                > Subject: [ydn-javascript] photo box
                >
                >
                >
                > Hi
                >
                > I need to display the photos as shown in the Photo Box example,
                > but in example, the url of photos are hardcoded...
                >
                > my question is how can we set the url of photos dynamically,which
                > picks the photo from database depending on the photoid?
                >
                > Any suggestions please
                >
                > Thanks
                > Priya
                >
              • sandysubha
                I just changed the static url in the photos:[{src: Sample.s?id= + id,caption:title}] now its working in firefox....but not in IE?? Any suggestions please to
                Message 7 of 10 , Aug 2, 2006
                • 0 Attachment
                  I just changed the static url in the

                  photos:[{src:"Sample.s?id="+ id,caption:title}]

                  now its working in firefox....but not in IE??

                  Any suggestions please to make photobox working in IE??

                  Thanks
                  Priya
                  --- In ydn-javascript@yahoogroups.com, "Steven Peterson"
                  <peterson@...> wrote:
                  >
                  > Priya,
                  >
                  >
                  >
                  > The PhotoBox is only a simple example. You can modify the code to
                  make them
                  > dynamic in whatever way you'd like, but that functionality isn't
                  built
                  > directly into the class. If you create a more complex version of
                  PhotoBox,
                  > please feel free to share it with the community!
                  >
                  >
                  >
                  > Thanks!
                  >
                  > Steven Peterson
                  >
                  > Web Developer, Platform Engineering
                  >
                  > Yahoo!
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > From: ydn-javascript@yahoogroups.com [mailto:ydn-
                  javascript@yahoogroups.com]
                  > On Behalf Of priya_806
                  > Sent: Tuesday, August 01, 2006 2:22 PM
                  > To: ydn-javascript@yahoogroups.com
                  > Subject: [ydn-javascript] photo box
                  >
                  >
                  >
                  > Hi
                  >
                  > I need to display the photos as shown in the Photo Box example,
                  > but in example, the url of photos are hardcoded...
                  >
                  > my question is how can we set the url of photos dynamically,which
                  > picks the photo from database depending on the photoid?
                  >
                  > Any suggestions please
                  >
                  > Thanks
                  > Priya
                  >
                • Steven Peterson
                  Priya, Can you please describe the problem? Thanks! Steven Peterson Web Developer, Platform Engineering Yahoo! From: ydn-javascript@yahoogroups.com
                  Message 8 of 10 , Aug 2, 2006
                  • 0 Attachment

                    Priya,

                     

                    Can you please describe the problem?


                    Thanks!

                    Steven Peterson

                    Web Developer, Platform Engineering

                    Yahoo!

                     

                     

                     

                    From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of sandysubha
                    Sent: Wednesday, August 02, 2006 3:01 PM
                    To: ydn-javascript@yahoogroups.com
                    Subject: [ydn-javascript] Re: photo box

                     

                    I just changed the static url in the

                    photos:[{src:"Sample.s?id="+ id,caption:title}]

                    now its working in firefox....but not in IE??

                    Any suggestions please to make photobox working in IE??

                    Thanks
                    Priya
                    --- In ydn-javascript@yahoogroups.com, "Steven Peterson"
                    <peterson@...> wrote:

                    >
                    > Priya,
                    >
                    >
                    >
                    > The PhotoBox is only a simple example. You can modify the code to
                    make them
                    > dynamic in whatever way you'd like, but that functionality isn't
                    built
                    > directly into the class. If you create a more complex version of
                    PhotoBox,
                    > please feel free to share it with the community!
                    >
                    >
                    >
                    > Thanks!
                    >
                    > Steven Peterson
                    >
                    > Web Developer, Platform Engineering
                    >
                    > Yahoo!
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    > From: ydn-javascript@yahoogroups.com
                    [mailto:ydn-
                    javascript@yahoogroups.com]
                    > On Behalf Of priya_806
                    > Sent: Tuesday, August 01, 2006 2:22 PM
                    > To: ydn-javascript@yahoogroups.com
                    > Subject: [ydn-javascript] photo box
                    >
                    >
                    >
                    > Hi
                    >
                    > I need to display the photos as shown in the Photo Box example,
                    > but in example, the url of photos are hardcoded...
                    >
                    > my question is how can we set the url of photos dynamically,which
                    > picks the photo from database depending on the photoid?
                    >
                    > Any suggestions please
                    >
                    > Thanks
                    > Priya
                    >

                  • cosmico81
                    I have written a php code that make photobox dynamic by the use of PHP. this script should be included in the head of your html/php document. It needs a script
                    Message 9 of 10 , Nov 23, 2006
                    • 0 Attachment
                      I have written a php code that make photobox dynamic by the use of PHP.

                      this script should be included in the head of your html/php document.
                      It needs a script (i've called it gallery.js) with the code of the
                      photobox and the word LISTA_IMG instead of the static list of photoes.
                      (it use two other files: lista_img with the list of image, with path,
                      one for line and lista_caption with the list in the same order of
                      capiton):

                      <?php
                      echo "<script>";
                      $replacement="";
                      $handle = fopen("collection/lista_img", "r");
                      $handle2 = fopen("collectiom/lista_caption", "r");
                      while (!feof($handle) && !feof($handle2)) {
                      $buffer1=fgets($handle, 4096);
                      $buffer2=fgets($handle2, 4096);
                      $replacement.=
                      "{src:\"http://www.your-site.it/".trim($buffer1)."\",caption:\"".trim($buffer2)."\"}";
                      if(!feof($handle)) {
                      $replacement.= ",";
                      }
                      }

                      $fg= fopen("gallery.js", "r");
                      while (!feof($fg)) {
                      $stringa=fgets($fg, 4096);
                      //echo $stringa;
                      echo preg_replace("|LISTA_IMG|", $replacement, $stringa);
                      }
                      fclose($fg);
                      fclose($handle);
                      fclose($handle2);
                      echo"</script>";
                      ?>



                      --- In ydn-javascript@yahoogroups.com, "Steven Peterson"
                      <peterson@...> wrote:
                      >
                      > Priya,
                      >
                      >
                      >
                      > The PhotoBox is only a simple example. You can modify the code to
                      make them
                      > dynamic in whatever way you'd like, but that functionality isn't built
                      > directly into the class. If you create a more complex version of
                      PhotoBox,
                      > please feel free to share it with the community!
                      >
                      >
                      >
                      > Thanks!
                      >
                      > Steven Peterson
                      >
                      > Web Developer, Platform Engineering
                      >
                      > Yahoo!
                      >
                      >
                      >
                      >
                      >
                      >
                      >
                      > From: ydn-javascript@yahoogroups.com
                      [mailto:ydn-javascript@yahoogroups.com]
                      > On Behalf Of priya_806
                      > Sent: Tuesday, August 01, 2006 2:22 PM
                      > To: ydn-javascript@yahoogroups.com
                      > Subject: [ydn-javascript] photo box
                      >
                      >
                      >
                      > Hi
                      >
                      > I need to display the photos as shown in the Photo Box example,
                      > but in example, the url of photos are hardcoded...
                      >
                      > my question is how can we set the url of photos dynamically,which
                      > picks the photo from database depending on the photoid?
                      >
                      > Any suggestions please
                      >
                      > Thanks
                      > Priya
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.