views:

38

answers:

0

Hi,

lets say i have the following html element on my host page:

<input type="text" onfocus="this.value = ''" id="textField"/>

In gwt i wrap this into an TextBox Widget like this:

final TextBox myTextBox = TextBox.wrap(DOM.getElementById("textField"));

If i now want to add a focus handler what will happen?

myTextBox.addFocusHandler(new FocusHandler() {

public void onFocus(final FocusEvent event) {
            // do something
        }
});

What i want to achieve is that first the javascript which was defined on the host page should be executed and after that my focus handler should be executed. But what actually is happening is that the javascript from the hostpage is not being executed and only the code within onFocus is executed. Is this behavoir normal? I would expect that add means actually add and not override. Is there a way to work arround this? Or do i maybe have any flaws which induce this behavoir. Any help is appreceated.

kuku