Thanks Krishna! Looks like it is working.
I try to avoid the usage of JSNI but I think in this case it is very
helpful.
Another thing.. I don't understand why it is not working when I have
more than one dialog at a time. I am redefining the close method for
each dialog I create, right? So, why doesn't each dialog close the way
it is defined?
- Simal
On Jul 4, 12:18 am, krishna <
krishnakum...@gmail.com> wrote:
> HiSimal,
>
> You can make it work without extending DialogBox (somewhat).
>
> ...
> final DialogBox dialogBox = new DialogBox();
> dialogBox.setHTML("Your Caption<img style=\"margin-top:
> 0px;cursor:pointer;cursor:hand\" src=\"close.png\" onclick=
> \"closeDialog()\"></img>");
> redefineClose(dialogBox);
> ...
> ...
>
> // Define closeDialog using JSNI
> private native void redefineClose(DialogBox dialogBox) /*-{
> $wnd['closeDialog'] = function () {
> dialogB...@com.google.gwt.user.client.ui.DialogBox::hide()();
> }
>
> }-*/;
>
> Code will not work if you have more than one dialog at a time, since
> we redefine the close method each time a new dialog is created.
>
> Regards,
> Krishna
>