cancel
Showing results for 
Search instead for 
Did you mean: 

Set the focus - Confirmation Dialog Box

0 Kudos

Dear all,

We implemented the pop-up of confirmation dialog box with 'YES' and 'NO' options on click of a particular button.

But, by default the focus is on 'YES' button.

How to change the focus to 'NO' button ?

Please help me.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try this:


IWDControllerInfo controllerInfo =
wdControllerAPI.getViewInfo().getViewController();
String dialogText = "Confirm Deletion";
IWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText,
controllerInfo.findInEventHandlers("YES"),
"Yes");
 
dialog.addChoice(
controllerInfo.findInEventHandlers("NO"), "No",true); 
// calling the addChoice method which has three arguments addChoice(IWDEventHandlerInfo eventHandler, java.lang.String label, boolean enabled)
dialog.open();
 

Regards,

Jaya.

0 Kudos

Dear Jaya,

I tried the way specified by you. But the focus is still on the 'YES' button. Thanks for your immediate reply.

Former Member
0 Kudos

Hi,

I dont see any other option insted of moving NO button to front.

Regards,

Charan

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Its not possible to change the default property of dialog box, here in your case what ever you add first is focussed by default

Check this thread also

Regards,

Saleem

pravesh_verma
Active Contributor
0 Kudos

Hi Wai,

The simple solution would be just to add the No button before the yes button. The code would look like this:


IWDControllerInfo controllerInfo =
wdControllerAPI.getViewInfo().getViewController();
String dialogText = "Confirm Deletion";
IWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText,
controllerInfo.findInEventHandlers("NO"),
"No");


dialog.addChoice(
controllerInfo.findInEventHandlers("YES"), "Yes");
dialog.open();

and then create two eventhandlers for Yes and No.

I hope this helps.

Thanks and Regards

Pravesh

0 Kudos

Dear Parvesh,

Thanks for your quick response.

We changed the sequence order of 'YES' and 'NO' buttons as specified by you.

I think we don't have other option. Do we have ?