Button.setTabIndex() on a popup (modal) window is not working

Hello there,
I have created an application where I have modal dialog window that displays an error. I have an Okay and Cancel button with a possiblity for more buttons. My user base is data entry users so tabbing is a key way to navigate through the app. I would like the user to be able to tab through the buttons of the modal window seemlessly and select their option.

I have tried button.setTabIndex(1) and so on and it does not seem to work?
Has anyone had any problems with setting tab index in modal windows? Is this an issue with focus? Is there a way to do this without having to click to get focus on the modal window first? I have been testing this in Firefox.

Any help would be appreciated.