lecosson / assql

Automatically exported from code.google.com/p/assql
0 stars 0 forks source link

Using showBusyCursor=true, the cursor never gets back for its normal state #76

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an instance of MySqlService using MXML, setting the parameter
showBusyCursor="true"

2. Make a query (causing an error or not)

What is the expected output? What do you see instead?
After obtaining any result from mysql, the busy cursor should be removed

What version of the product are you using? On what operating system?
asSQL Beta2.7 (source code)

Please provide any additional information below.

com.maclema.mysql.mxml.MySqlService = The following code is ineffective:

    public function MySqlService()
    {
        addEventListener(MySqlErrorEvent.SQL_ERROR, removeBusyCursor);
        addEventListener(MySqlEvent.RESULT, removeBusyCursor);
        addEventListener(MySqlEvent.RESPONSE, removeBusyCursor);
        addEventListener(Event.CLOSE, removeBusyCursor);
    }

Neither this class or its superclass dispatches these events;
To get it working, I've to change the code to this:

    public function MySqlService()
    {

    }

    override public function send(queryObject:*):MySqlToken {
        var token:MySqlToken = super.send(queryObject);
        if ( showBusyCursor ) {
            CursorManager.setBusyCursor();
            /* added these lines: */
            token.addEventListener(MySqlErrorEvent.SQL_ERROR,
removeBusyCursor);
            token.addEventListener(MySqlEvent.RESULT, removeBusyCursor);
            token.addEventListener(MySqlEvent.RESPONSE, removeBusyCursor);
            token.addEventListener(Event.CLOSE, removeBusyCursor);
            /**********************/
        }
        return token;
    }

Original issue reported on code.google.com by pablotor...@gmail.com on 26 Mar 2009 at 8:17

GoogleCodeExporter commented 9 years ago
Forgot this, also needed to change to get it working:

From:
    private function removeBusyCursor(e:MySqlEvent=null):void {
        CursorManager.removeBusyCursor();
    }

To:
    private function removeBusyCursor(e:Event=null):void {
        CursorManager.removeBusyCursor();
    }

Because the method receives 3 types of event, not only MySqlEvent

Original comment by pablotor...@gmail.com on 26 Mar 2009 at 8:21

GoogleCodeExporter commented 9 years ago

Original comment by celeryn...@gmail.com on 24 May 2009 at 9:13

GoogleCodeExporter commented 9 years ago
Committed to subversion 178.

Original comment by celeryn...@gmail.com on 24 May 2009 at 9:22