OK, thanks Ian!

I surmise from your post that I should just create one RTA and re-use
it, I'll give that a try...ya, works fine and fixes the issue. Not
sure if I should fill out a bug report or not...

I assume that the resources DO NOT get cleaned up once I don't have
references to the dialog box anymore??

Thanks,

Mark


On Sep 29, 6:20 pm, Ian Bambury <[email protected]> wrote:
> You can cut out quite a lot of that code and still get the same effect.
> And then (or now) all you have to do is to leave the cursor in the rich text
> area and cancel (or do anything else to hide it).
>
> Because you are leaving RTAs lying about but not visible, and because the
> RTA is in an IFRAME, and because the focus remains in the iframe and because
> it's not visible, you end up with the focus stuck in an invisible frame. At
> least, I think that's the problem.
>
> Yes, it probably shouldn't do that, but on the other hand, if you stop
> leaving them lying about...if not for the focus problem, then for the sake
> of your users' memory.
>
> You will probably save yourself a lot of pain and gnashing of teeth if you
> give up on RTAs now. They may be OK if you really don't mind what html and
> JS your users paste in there.
>
> Ian
>
> http://examples.roughian.com
>
> 2009/9/29 mwaschkowski <[email protected]>
>
>
>
>
>
> >  I forgot to add, but the following is a workaround, and makes both
> > the TextBox and RichTextArea editable.
>
> >                categoryTextBox.addClickHandler(new ClickHandler() {
> >                         @Override
> >                        public void onClick(ClickEvent event) {
> >                                 categoryTextBox.setFocus(true);
> >                                categoryTextBox.setCursorPos(0);
> >                        }
> >                });
>
> > On Sep 29, 2:37 pm, mwaschkowski <[email protected]> wrote:
> > > Not sure why, but the below code stops working in IE (works fine for
> > > me in chrome).
>
> > > In IE, do the following:
>
> > > 1) click Show Dialog
> > > 2) enter '1' into the TextBox AND into the RichTextArea
> > > 3) press cancel
> > > 4) click Show Dialog
>
> > > On my box, both the TextBox and RichTextArea become un-editable (like
> > > setEnabled(false) was called).
>
> > > Other people notice the same? If so, I'll fill out a bug report. If
> > > I'm doing something incorrectly, just let me know...
>
> > > Thanks,
>
> > > Mark
>
> > > package com.test.client;
>
> > > import com.google.gwt.core.client.EntryPoint;
> > > import com.google.gwt.event.dom.client.ClickEvent;
> > > import com.google.gwt.event.dom.client.ClickHandler;
> > > import com.google.gwt.user.client.ui.Button;
> > > import com.google.gwt.user.client.ui.DialogBox;
> > > import com.google.gwt.user.client.ui.FlexTable;
> > > import com.google.gwt.user.client.ui.HorizontalPanel;
> > > import com.google.gwt.user.client.ui.Label;
> > > import com.google.gwt.user.client.ui.PopupPanel;
> > > import com.google.gwt.user.client.ui.RichTextArea;
> > > import com.google.gwt.user.client.ui.RootPanel;
> > > import com.google.gwt.user.client.ui.TextBox;
> > > import com.google.gwt.user.client.ui.VerticalPanel;
>
> > > /**
> > >  * Entry point classes define <code>onModuleLoad()</code>.
> > >  */
> > > public class RichTextAreaTest implements EntryPoint {
>
> > >         /**
> > >          * This is the entry point method.
> > >          */
> > >         public void onModuleLoad() {
>
> > >                 Button showButton = new Button("Show", new ClickHandler()
> > {
> > >                         @Override
> > >                         public void onClick(ClickEvent event) {
> > >                                 PopupPanel popup = getPopup();
> > >                                 popup.show();
> > >                         }
> > >                 });
>
> > >                 Button showDialogButton = new Button("Show Dialog", new
> > ClickHandler
> > > () {
> > >                         public void onClick(ClickEvent event) {
> > >                                 DialogBox dialogBox = getDialogBox();
> > >                                 dialogBox.setAutoHideEnabled(true);
> > >                                 dialogBox.show();
> > >                         }
> > >                 });
>
> > >                 RootPanel.get().add(showButton);
> > >                 RootPanel.get().add(showDialogButton);
> > >         }
>
> > >         private DialogBox getDialogBox(){
> > >                 final DialogBox db = new DialogBox();
>
> > >                 Label categoryLabel = new Label("Category");
> > >                 TextBox categoryTextBox = new TextBox();
>
> > >                 Label contentLabel = new Label("Content");
> > >                 RichTextArea contentTextArea = new RichTextArea();
>
> > >                 //setup inputs
> > >                 FlexTable table = new FlexTable();
> > >                 table.setWidget(0, 0, categoryLabel);
> > >                 table.setWidget(0, 1, categoryTextBox);
> > >                 table.setWidget(1, 0, contentLabel);
> > >                 table.setWidget(1, 1, contentTextArea);
> > >                 //if above gets commented out, then everything works as
> > expected
>
> > >                 //setup buttons
> > >                 Button cancelButton = new Button("Cancel", new
> > ClickHandler() {
> > >                         @Override
> > >                         public void onClick(ClickEvent event) {
> > >                                 db.hide();
> > >                         }
> > >                 });
>
> > >                 HorizontalPanel hp = new HorizontalPanel();
> > >                 hp.add(cancelButton);
>
> > >                 VerticalPanel mainPanel = new VerticalPanel();
> > >                 mainPanel.add(table);
> > >                 mainPanel.add(hp);
>
> > >                 db.add(mainPanel);
> > >                 return db;
> > >         }
>
> > >         private PopupPanel getPopup() {
> > >                 final PopupPanel popup = new PopupPanel(true);
> > >                 VerticalPanel panel = new VerticalPanel();
> > >                 panel.add(new TextBox());
> > >                 panel.add(new RichTextArea());
> > >                 popup.setWidget(panel);
> > >                 return popup;
> > >         }
>
> > > }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to