Flyout windows must be opened manually.
The entire interface is soup. A flyout must also be pointed to a valid HTML page (locally or remotely, it doesn't matter). Once loaded, however, you can treat the DOM however you like.
That being said, capture the "search" event and make it display to the flyout DOM. This could be with a redirect of the flyout itself, an iframe with a dynamically set target, or other DOM manipulation.
One trick I have used is to use a "generic" flyout which simply invokes a method on the parent window passing in itself as a parameter (flyouts are are just child windows) and then let the "main" gadget actually handle the DOM work based on context.
// in "fuout.html"
jQuery(function ($j) {
var parent = System.Gadget.document
parent.loadFuout(document, $j)
})
// in main gadget html
document.loadFuout = function (fuout, _j) {
// other stuff based on current flyout context...
// fuout is document object of flyout
}
Please note: in my case I run a slightly modified jQuery in which document is bound in a closure. This allows me to refer to the "correct jQuery object for the document", above that is accessed via _j.