Thanks for your help :) It would be nice to get back to a gwt solution, rather then having mess bits of native.
My widget already extends DialogBox; Replaceing my; this.setHTML("<div class=\"captiontext\"> - Post a new review - </ div><a href=\"#\"><div onclick=\"closeDialog()\" class=\"closeimage \"></div></a>"); line with; Element td = getCellElement(0, 1); DOM.appendChild(td, caption.getElement()); adopt(caption); caption.setStyleName("Caption"); caption.addMouseListener(this); However, results in a message telling my caption is not visible...presumably because its Private in the DialogBox class? I have been looking inside the gwt dialog widget while playinga bout this whole time, but I'm just not good enough to work out precisely what I need to do from that. To be honest, I'm not even sure if I could add a widget to the panel without resulting to native html+javascript it would solve my core problem; How would you have an image file being clicked change a history token? Would Image need to be extended with dom calls to do that? On Apr 17, 10:12 am, Salvador Diaz <diaz.salva...@gmail.com> wrote: > * 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 <darkfl...@gmail.com> 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 <darkfl...@gmail.com> 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 <darkfl...@gmail.com> 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\" >   </ > > > > div>"); > > > > > redefineClose(QuickReviewPopUp); > > > > > .. > > > > > private native void redefineClose(DialogBox dialogBox) /*-{ > > > > $wnd['closeDialog'] = function () { > > > > dialogb...@com.google.gwt.user.client.ui.dialogbox::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 Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---