Wednesday, January 13, 2010

Tomahawk Popup loss of focus

A while back I realized that when using the tomahawk popup component (t:popup) in my ADF faces page that I was having a problem: whenever I had a field (like an af:inputText) inside the popped-up region along with something else, I would get some behaviour I did not want: as soon as my cursor left the field (but stayed within the popup region) focus would leave the input field. This made it awkward when I wanted to have a search field in the popup. But I found a simple solution: in the inputText's onblur property, put the following code: try{ this.focus(); } catch(e){}

What this does is keep it there rather than lose focus. I would really like to know what code is making this field lose focus. I did some searching, but it was very slow going for me, and I needed a quick fix.

No comments: