I've got a spark button on a screen, and I'm updating the label dynamically using actionscript like so:
discount.label = this.data.SelectedDiscount.discount + "%";
The problem is that the new label text is truncated, even though there is room for it.
Initially the label in the button is blank:
Then after I change the label with the code above it looks like this, when it should say "30 %":
However, if I then click the button it updates the display and renders it correctly:
I've tried all the various invalidate and validate methods, playing with the button width and more, all to no avail. If the initial label is wider, with a value like "-------" then it works ok, but unfortunately a string of whitespace doesn't do the trick. I don't really want a string of "0%" or "00%" for usability reasons so is there any easy way to get this working properly?
Preferably I'd like to avoid having to fake a mouse click just to achieve this.