A small upgrade...
Just a small upgrade to FlexInBoxStock tonight. I changed the StockQuote component so that it adds a busy cursor as well as disabling the "Add" button once it's clicked. The cursor shows busy and the button is disabled until the quotes are returned. This doesn't affect the polling, so there is no busy cursor unless new stock symbols are added.
The example is here.
Here's the code that makes it happen.
addStockButton.enabled = false;
CursorManager.setBusyCursor();
var newSymbols:Array = stockSymbol.text.split(',');
newSymbols.forEach(addToCurrent)
stockSymbol.text = "";
getQuotes();
}
First, I set the enabled property of the addStockButton to false. The addStockButton is the value of the id attribute in the
Next, I called the setBusyCursor() method of the CursorManager.
The final change was in the rGetQuotes() function.
acCurrentSymbols = new ArrayCollection(event.result as Array);
if(!addStockButton.enabled){
addStockButton.enabled = true;
CursorManager.removeBusyCursor();
}
}
Here, I run an if statement to see if the enabled property of addStockButton is false. If it is, I set the enabled property to true and remove the busy cursor by calling the removeBusyCursor() method.
As always, if you have any questions or feedback, feel free to let me know.
Download the source here: FlexInABoxStock.zip


There are no comments for this entry.
[Add Comment]