Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    showPrompt with animated gif

    I want do display a modal window with a "please wait" message and animated gif while doing some rpc requests.

    I can get the dialog to appear but the gif image appears in the window header and not in the body. Can somebody please tell me what I am doing wrong or if there is an easier way to do it?

    Code:
    isc.showPrompt("Searching...", {title: "Please Wait", items: isc.Canvas.create({contents: "<img src='img/busy.gif'>"})});
    Thanks

    #2
    Showing a prompt is built-in (see rpcRequest.showPrompt). The best way to add a spinning .gif is to include it in the prompt text itself - call isc.Canvas.imgHTML() to form the HTML for it.

    Comment


      #3
      Sweet! I didn't realize the request object had it's own prompt argument.

      I have a (somewhat related) question about the imgHTML method. It looks like, by default, it tries to locate the image file in an "images" directory. I am able to get around this by setting imgDir to "../img/", ie:

      Code:
      isc.Canvas.imgHTML({imgDir: "../img/", src: "busy.gif"})
      This seems less than optimal. I found an appImgDir on the canvas but this doesn't seem to help. Is there a way around this without effecting where SmartClient finds its own images?

      Thanks again.

      Comment


        #4
        If the image is in your appImgDir, use "[APP]busy.gif".

        Comment


          #5
          I couldn't change the text within the prompt window

          here's my code:

          isc.showPrompt(
          "Loading data...",
          {
          title: "different text",
          bodyColor: "#FFFFFF",
          items: isc.Canvas.imgHTML({src: "[APP]photos/loading6.gif"})
          }
          )

          the difference is that i see the gif on the top left of the window and color was changed to white.
          How do i change the text within the window?
          How do i control the place of the gif?
          Last edited by Gil Malina; 10 Aug 2009, 04:33.

          Comment


            #6
            just add the image HTML to the prompt itself, and append prompt text as you see fit, like

            isc.showPrompt(
            isc.Canvas.imgHTML({src: "[APP]photos/loading6.gif"}) + " - Loading data...",
            {
            title: "different text",
            bodyColor: "#FFFFFF"
            }
            )

            Comment


              #7
              Thanks for the quick answer.
              I change it, and I can see the gif for a tenth of a second
              and then it changes to ordinary prompt (i.e. "Finding records that match your criteria..." ).
              This is wierd because the white color stays.

              Is there a connection to the fact that when my application starts there are two trees trhat loads automatically?

              Comment


                #8
                There only one modal prompt at a time and it's being taken over by the TreeGrid(s).

                Use the search feature in the docs for all the places you can override prompt - you can make those TreeGrids use your custom prompt, you could instead turn the prompt off on the TreeGrid requests so that you manual prompt remains, or you can change the system-wide default prompts so that they all include your animating gif.

                Comment

                Working...
                X