Hi,
I have some panels that take a long time to load. I would like to prompt the user to wait with a modal message, basically to prevent the user from pushing multiple times on the same button thinking that the panel loading was not started. Here is the code that I thought would do the trick:
The slow command is tableMenuRecord.getPanel() which has to build the panel when called for the first time.
The problem is that the prompt does not really pop up before the ScheduledCommand command starts, it actually pops up almost at the end and is therefore directly cleared and is useless.
I have tried with DeferredCommand (which is deprecated and replaced by Scheduler stuffs) as suggested in the doc of showPrompt but with the same result.
Thanks for your help, Ben
I have some panels that take a long time to load. I would like to prompt the user to wait with a modal message, basically to prevent the user from pushing multiple times on the same button thinking that the panel loading was not started. Here is the code that I thought would do the trick:
Code:
public void onRecordNavigationClick(RecordNavigationClickEvent event) { SC.showPrompt("Please wait","Loading screen ..."); final TableMenuRecord tableMenuRecord = (TableMenuRecord)event.getRecord(); Scheduler.get().scheduleDeferred(new ScheduledCommand(){ public void execute() { changeScreen((Screen)tableMenuRecord.getPanel()); SC.clearPrompt(); } }); }
The problem is that the prompt does not really pop up before the ScheduledCommand command starts, it actually pops up almost at the end and is therefore directly cleared and is useless.
I have tried with DeferredCommand (which is deprecated and replaced by Scheduler stuffs) as suggested in the doc of showPrompt but with the same result.
Thanks for your help, Ben
Comment