* Create a class that extends DialogBox
* In your constructor, hack away the caption through DOM calls
* Create the widget that you want to add to the caption (it must
implement SourcesMouseEvents if you want to be able to drag the
dialog)
* Attach your new widget to the dialog through DOM calls (just like
the caption gets attached to the dialog box):

    // Add the caption to the top row of the decorator panel. We need
to
    // logically adopt the caption so we can catch mouse events.
    Element td = getCellElement(0, 1);
    DOM.appendChild(td, caption.getElement());
    adopt(caption);
    caption.setStyleName("Caption");
    caption.addMouseListener(this);

More often than not, just looking at the source code for GWT standard
widgets will tell you how to do things that are not avaliable in
standard GWT widgets.

I hope it helps.

Cheers,

Salvador

On Apr 17, 8:49 am, Darkflame <[email protected]> wrote:
> Still having trouble with this.
>
> Anyone got any ideas?
>
> Either what html is needed to make  a bookmark that dosnt refresh IE,
> or native javascript that would clear the history token. (or well, set
> it to anything).
>
> On Apr 11, 11:27 am, Darkflame <[email protected]> wrote:
>
> > Just to clarify my attempted solution and why it isnt working;
>
> > <a href="#PostNewReview"> Post Quick Review </a>
>
> > Is the html produced by one of the standard Hyperlinks in GWT. This
> > works fine, it triggers history, and it dosnt refresh the page in IE.
>
> > This however, is the html produced by my attempt at having a close "X"
> > in the corner of the dialogue box clear the history token;
>
> > <a href="#">
> > <div class="closeimage" onclick="closeDialog()"/>
> > </a>
>
> > This, annoyingly, cause's the page to refresh in IE.
>
> > Why  :?
>
> > On Apr 10, 12:02 pm, darkflame <[email protected]> wrote:
>
> > > I tried googleing for this without much success, despite the fact its
> > > really more a javascript rather then GWT query, I couldnt find
> > > anywhere else with an answer.
>
> > > Basicaly I have a gwt application which triggers a pop-up window,
> > > which is an extension of DialogBox.
>
> > > Because I wanted a windows like "X" in the corner to close it, I
> > > followed some advice and altered the titlebar of it with;
>
> > >  this.setHTML("<div class=\"captiontext\"> - Title Here - </div><div
> > > onclick=\"closeDialog()\" class=\"closeimage\" >&nbsp&nbsp&nbsp</
> > > div>");
>
> > > redefineClose(QuickReviewPopUp);
>
> > > ..
>
> > > private native void redefineClose(DialogBox dialogBox) /*-{
> > >            $wnd['closeDialog'] = function () {
> > >            [email protected]::hide()();
> > >            }
>
> > > }-*/;
>
> > > This works, the dialogue close's nicely. When the x is hit.
>
> > > However, as I'm not using a normal link to close it, I have no idea
> > > how to clear the history token.
> > > The historytoken is changed when the popup appears as I want the state
> > > of if its open/close to be saved, but I cant work out how to set it
> > > back when it closes.
> > > Is there a javascript function I could put in the refdefineClose that
> > > would do this?
>
> > > I tried using    (<a href="#"></a>) around the divs in the link that
> > > triggers the native javascript, but aside from looking messy,all this
> > > reloads the page.
> > > (at least in IE, but the normal internal hyperlinks triggering the
> > > popups dont reload the page in IE, so clearly there must be some
> > > difference)
--~--~---------~--~----~------------~-------~--~----~
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