Announcement

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

    addDrawHandler issue

    I need help to understand how addDrawHandler works.

    In my application, I have 2 vertical layouts (called startLayout and mainLayout). Initially, startLayout is displayed and mainLayout is hidden. startLayout has a button (called startButton). When the start button is clicked, I call startLayout.hide(), SC.showPrompt("Loading data...") to display a prompt, do some processing and then show the mainLayout.

    I have registered addDrawHandler for the mainLayout like this:

    Code:
        mainLayout.addDrawHandler(new DrawHandler() {
            public void onDraw(DrawEvent event) {
                SC.clearPrompt();				
            }        	
        });
    After the data is fetched, I call mainLayout.show(). At this point, I expect the prompt to be cleared when onDraw() is called. But what I found is that this works intermittently. The mainLayout is displayed, but the prompt isn't always cleared. However, if I manually call SC.clearPrompt() right before calling mainLayout.show(), the prompt is cleared consistently.

    One other thing I noticed is that if the processing is quick, the prompt isn't cleared. But when the processing takes a while, the prompt is cleared.

    Please help me understand whether I'm missing something or DrawHandler isn't working properly.

    Thanks.

    #2
    also interested. Waiting for an answer

    Comment


      #3
      The problem I've described above is on the PC. But, I have found the pop-up prompt window troublesome in more ways, especially on the iPhone. For example, on the iPhone, most of the times, the window doesn't center properly on the screen. Also (again on the iPhone), the prompt doesn't clear many times and practically hangs the entire application (the same prompt clears consistently on the desktop).

      I tried a few things to troubleshoot the problem and finally decided to get rid of it completely. Now I've created a layout that simply has a "Loading data..." label. I just show this layout instead of the prompt, and it works reliably and consistently.

      I still have problems with the Yes/No (SC.ask) prompt on the iPhone. Most of the times, the window is so much out of the screen that the Yes/No buttons are inaccessible. When I try to scroll and reach for the buttons, the window jumps out of the screen again. The only way to catch the buttons is to scroll and click in one instance.

      I'm not sure whether anyone else has experienced these issues. Since I'd been busy with other higher priority issues, I had not reported these issues earlier.
      Last edited by deepfriedbrain; 31 May 2011, 04:04.

      Comment


        #4
        On your previous question, if you've left the default of showPrompt:true on RPCManager/DataSource, the prompt is automatically shown and hidden for server calls, so your code is not the only thing manipulating it.

        On the iPhone, as far as SC.ask() your problems may be due to how you've set the viewport, which affects the maximum size detected by SmartGWT, or to creating other widgets that expand the viewport (even if hidden). Can you show a test case for this?

        As far as using promptStyle:"window" on the iPhone, we wouldn't recommend this - most mobile apps show a more subdued-looking throbber instead.

        Comment

        Working...
        X