Thanks. That was exactly the cure--do hide/show on the RootLayoutPanel vs the widget inside.
On Jul 21, 6:54 pm, Thomas Broyer <[email protected]> wrote: > On Jul 21, 8:32 pm, Thad <[email protected]> wrote: > > > > > I'm testing moving my application from a RootPanel to > > RootLayoutPanel. Given my layout, it's not a 1-to-1 swap, and the end > > result is some focusing problems with my logon from. > > > My HTML page contains an <iframe> for GWT history, an <iframe> that > > serves as target for downloading files (so I don't have to open a > > browser window), a <form> for logging on, and a <div> for my > > application that RootPanel.get(String) retrieves. The logon form's > > action is attached via JSNI. The HTML page carries and onload() > > script that focuses the cursor in the username field. After logon, > > the form is hidden and the application <div> shows. On logout, I hide > > and clear the main panel and show the logon form. This works fine in > > all browsers. > > > However RootLayoutPanel has no get(String) method. So I call > > get().add(new ScrollPanel(myAppPanel)), bypassing the old <div>. This > > *seems* to work well, but if the user clicks *anywhere* on the page, > > the form loses focus. The focus cannot be regained unless the user > > tabs through the browser window waiting for the username to highlight. > > > Looking in Firebug, I think the problem is a <div> of GWT's making: > > <div style="position: absolute; z-index: -32767; left: -20cm; top: > > -20cm; width: 10cm; height: 10cm;"> </div> > > > Is that's what's doing it? What is this <div> for? How can I get > > around this focus problem, or do I need to stick with RootPanel? > > The div is probably the RootLayoutPanel itself. Can't you show/hide > the RootLayoutPanel to show/hide the app and hide/reveal the login > form? Another idea: use position absolute (or relative) and a high z- > index on your login form to make it appear in front of the > RootLayoutPanel. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
