A couple of flyout questions

I know that the flyout can't fire unless the gadget has focus. I want to make a gadget launch a reminder at certain times, I have a less conveniant fallback method, but I'd prefer to get focus on the gadget first. Does anyone know of a workaround

Secondly, is it possible to launch a flyout whilst keeping focus of an input box on the Gadget I want to use the flyout as a little helper window to aid the user input.

Andy




Answer this question

A couple of flyout questions

  • Lakshmi N

    Thanks Jonathan,

    Didn't realise I had to use a timer. I had tried self.focus() but it didn't work... now i know why :)

    Andy E



  • j2associates

    Bug#12 on the known bugs list!

  • crogenicdude

    Use "focus()" to set focus, ie "self.focus()" to put focus on the current code, or "document.<id>.focus()" to set focus on an element.

    As you want to set focus back to the Gadget after opening the Flyout, add the following code to the end of your flyout.html:

    <script language="javascript" type="text/javascript">
    setTimeout(setFocusBack, 300);

    function setFocusBack() {System.Gadget.document.parentWindow.<id>.focus()}
    </script>

  • A couple of flyout questions