Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Custom XBL control can't get focus.

0 views
Skip to first unread message

Jaywalker

unread,
Jun 22, 2009, 11:53:20 AM6/22/09
to
Hey again,

As mentioned in another thread, I created a custom list extending
listbox_base.
To go further away from that I also just created my completely own
list control with list items and so on (copying listbox.xml and
altering it to my needs).

Anyway, both ways lead to the same problem: my list control can never
receive focus and thus keypress events won't work.

I already checked the following website:
https://wiki.mozilla.org/XUL:Focus_Behaviour

but I didn't find a reason there for not getting focus.

To solve my problem, I may need to know, how focusing XUL elements
works in general. How does an element receive focus when i click on
it?

May my problem be, that I don't provide my own nsIAccessibleProvider
for my control? (Didn't look into accessibility yet).

I am thankful for every hint!

Neil Deakin

unread,
Jun 22, 2009, 2:29:52 PM6/22/09
to
Jaywalker wrote:
> Hey again,
>
> As mentioned in another thread, I created a custom list extending
> listbox_base.
> To go further away from that I also just created my completely own
> list control with list items and so on (copying listbox.xml and
> altering it to my needs).
>
> Anyway, both ways lead to the same problem: my list control can never
> receive focus and thus keypress events won't work.
>
> I already checked the following website:
> https://wiki.mozilla.org/XUL:Focus_Behaviour
>
> but I didn't find a reason there for not getting focus.
>
> To solve my problem, I may need to know, how focusing XUL elements
> works in general. How does an element receive focus when i click on
> it?

Likely you haven't made the element focusable. Controls should implement
nsIDOMXULControlElement and you should have -moz-user-focus: normal set.

Jaywalker

unread,
Jun 22, 2009, 3:02:13 PM6/22/09
to

> Likely you haven't made the element focusable. Controls should implement
> nsIDOMXULControlElement and you should have -moz-user-focus: normal set.

Thanks! I did the first, but forgot the second. I kinda had the stupid
assumption, that "normal" was default. *boing*

Thank you a lot! :)

0 new messages