Change WebControl TabOrder at run time

Hello,

Is it possible to change the WebControl TabOrder at run time? It seems that I am unable to find such information in the forum and http://documentation.xojo.com/

Any help is greatly appreciated.

I don’t think so. TabOrder is not accessible by code AFAIK.

And it cannot be changed in JavaScript either.

[quote=315206:@Michel Bujardet]I don’t think so. TabOrder is not accessible by code AFAIK.

And it cannot be changed in JavaScript either.[/quote]
Hello Michel,

I have a WebDialog and its Super is CustomWebDialog. In CustomWebDialog, I created 2 Web buttons.

In the WebDialog IDE, I won’t be able to see the 2 WebButtons. How do I rearrange the TabOrder of the 2 Web buttons in my WebDialog IDE?

That is the reason why I was thinking being able to change the TabOrder at runtime.

Can’t you make the WebDialog bigger to show the two buttons ?

Alternatively, you should be able use Setfocus to set the focus on the button you want, in the webpage keypressed event when chr(9) is detected in KeyEvent.

[quote=315221:@Michel Bujardet]Can’t you make the WebDialog bigger to show the two buttons ?

Alternatively, you should be able use Setfocus to set the focus on the button you want, in the webpage keypressed event when chr(9) is detected in KeyEvent.[/quote]

Hello Michel,

I think you had mistaken my reply. I am able to view the 2 buttons at runtime. I meant I am unable to view the 2 buttons in WebDialog IDE as the physical 2 buttons are in the CustomWebDialog.

Since it is not possible to set the TabOrder in IDE for this instance, then I think I will have to use the SetFocus function instead. Thanks for your reply.

Hello Michel,

It seems like the KeyEvent for TabKey does not work in Browser.
https://forum.xojo.com/29943-understanding-the-details-function/0

Well, then you could try to make invisible the button you don’t want tab to go to.

Actually, it is the sequence of the TabOrder which is wrong

Alvin, I do not understand. You can change the TabOrder in the Inspector. Why should it change at run time ?

Last possibility : create two identical WebContainers with your controls, and for each, set the taborder as you like it. Then instantiate them depending on what you need.

I am done. I don’t see any other way.

Ok Michel, thanks for all the suggestions.

If you edit your CustomWebDialog item from the navigator and not try to access the instance of the dialog that is dropped on your web page, you can set the tab order for the controls that are on the dialog.

Hello Scott,

Thanks for your reply. If you are interested, you may want to take a look at this sample Xojo project which I had just created. https://www.dropbox.com/s/8hr0rywetgvjedf/untitled.xojo_binary_project?dl=0

I won’t be able to get the sequence of the Button TabOrder correctly and I won’t be able to adjust the TabOrder in the IDE Inspector.

When running the WebApp, when you TabKey after the second WebField, it suppose to move to Save Button, but the focus is missing.

On Mac you have to enable focusing to all controls in System Preferences for this kind of behavior.

One of the issues you are encountering here is that tab order is dependent on the order that the controls are rendered to the underlying HTML. Changing this would require extensive DOM manipulation to achieve correctly.

As far as controls that accept tabs, only the ones with built-in os counterparts (textfield, textarea, checkbox, radiobuttons, buttons, popupmenus) work at this time.

There is already a feature request to fix this.