PDA

View Full Version : Hourglass question



gorilla076
2 Aug 2010, 7:16 AM
I need to set the cursor to an hourglass from within a dialog while an rpc call is being made, but I've yet to find an example on how to do this.

Here's my code (cursor is never set to hourglass).



public class MyDialog extends Dialog
{
public MyDialog()
{
initButtons();
}

private void initButtons()
{
Button btn = getButtonById(Dialog.OK);

btn.addSelectionListener(new SelectionListener<ButtonEvent>()
{
@Override
public void componentSelected(ButtonEvent ce)
{
doStuff();
}
});

private void doStuff()
{
setStyleAttribute("cursor", "wait");

// rpc call is made here... on success/failure I make the same call to set the cursor back to default
}

}