Oh right, sorry, missed the 'protected' keyword in the javadoc. Note however
that HasWidgets extends Iterable (hence the existence of
RootPanel.get().iterator()) so you could write "for (Widget w :
RootPanel.get()) { ... }" (not sure I like it though)
--
You received this message because you a
Sorry, getChildren() does exist, however, it's a protected method.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/EJo_4b9Lj6oJ.
To post to this
getChildren() doesn't exist (in GWT 2.2.0). However, I could have
used RootPanel.get().iterator().
I would have thought when GWT compiled the widgets, they would turn into a
or something similar, and their type would be lost, however, I'm
clearly wrong, as it works a treat!
--
You received
Any reason you don't use an "enhanced for loop"? for (Widget widget :
RootPanel.get().getChildren()) { ... }
It works because it's looping on widgets, not elements (look at the code,
there's an ArrayList to store the child widgets; there's no magic)
--
You received this message because you are
Thanks Thomas. Much cleaner that way!
New code:
/**
* @return the number of modal popups currently showing
*/
public static int getNumPopupsShowing() {
int result = 0;
for (int i=0; ihttps://groups.google.com/d/msg/google-web-toolkit/-/Zbhl1FMbOXsJ.
To post to this group, send email to google
Thanks Thomas. Much cleaner that way!
New code:
/**
* @return the number of modal popups currently showing
*/
public static int getNumPopupsShowing() {
int result = 0;
for (int i=0; ihttps://groups.google.com/d/msg/google-web-toolkit/-/aS7a8ASVEIEJ.
To post to this group, send email to google
PopupPanels append themselves to RootPanel.get(), so you can loop over
RootPanel.get().getChildren() and whenever you see a PopupPanel you can ask
if it isShowing().
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion
Not sure, if there is a automatic way of detecting all child windows
to a parent window on demand,
but certainly you can main maintain, global array list and every popup
window that you open, and
call close on each of those. You can lot of examples in javascript -
"closing child windows to idea".
Thanks Ashwin. Yes, sorry, should have been a little more clear, I wanted
to detect if a popup is showing, "which I didn't already have the reference
to".
Apologies for not being more clear.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" gro
Popup Panels have a isShowing() method, use that to determine if its
currently displayed
~Ashwin
On Tue, Jul 12, 2011 at 6:30 AM, Craig Mitchell wrote:
> Hi,
>
> I wanted to check if a popup is showing, so I wrote this method:
>
> public static int getNumPopupsShowing() {
> int result = 0;
> No
Hi,
I wanted to check if a popup is showing, so I wrote this method:
public static int getNumPopupsShowing() {
int result = 0;
NodeList divs = Document.get().getElementsByTagName("div");
for (int i=0; ihttps://groups.google.com/d/msg/google-web-toolkit/-/Jwf77I4AUsoJ.
To post to this group, send
11 matches
Mail list logo