SUPER,
Thank you very much.
I thought that worked like dialogClosed(Dialog dialog, boolean modal) {
TY again
Jérôme
-----Message d'origine-----
De : Chris Bartlett [mailto:[email protected]]
Envoyé : mercredi 20 juillet 2011 23:23
À : [email protected]
Objet : Re: DialogStateListener
Jérôme,
Ahh, I see the problem now. You create a DialogStateListener, but it
is not being added to the Dialog's list of DialogStateListeners.
Replace this...
windowActivite.open(window, dsl);
with this ...
windowActivite.getDialogStateListeners().add(dsl);
windowActivite.open(window);
You were calling
http://pivot.apache.org/2.0/docs/api/org/apache/pivot/wtk/Dialog.html#open(o
rg.apache.pivot.wtk.Window,
org.apache.pivot.wtk.DialogCloseListener)
which will accept a DialogStateListener as the 2nd parameter, as
DialogStateListener extends DialogCloseListener.
Chris
On 20 July 2011 22:57, Jérôme Serré <[email protected]> wrote:
> Hello,
>
>
>
> Im trying to use a DialogStateListener but it doesnt work !
>
> When the window (dialog) closes the methods :
>
>
>
> public void dialogCloseVetoed(Dialog arg0, Vote arg1) {
>
> and
>
> public Vote previewDialogClose(Dialog arg0, boolean arg1) {
>
> are never call, only this is call
>
> public void dialogClosed(Dialog dialog, boolean modal) {
>
>
>
> What is wrong in may code ?
>
> Someone can help me ?
>
>
>
> Thank you
>
>
>
> Jérôme
>
>
>
> final WindowActivite windowActivite =
> (WindowActivite)wtkxSerializer.readObject(WindowActivite.class.getReso
> urce("/applet/activite.bxml"),
> resources);
>
> DialogStateListener dsl = (new DialogStateListener() {
>
> public void dialogClosed(Dialog dialog, boolean
> modal) {
>
> System.out.println("dialogClosed");
>
>
>
> }
>
> @Override
>
> public void dialogCloseVetoed(Dialog arg0, Vote
> arg1) {
>
> System.out.println("dialogCloseVetoed");
>
> System.out.println("vote: " + arg1);
>
> }
>
> @Override
>
> public Vote previewDialogClose(Dialog arg0,
> boolean
> arg1) {
>
> System.out.println("previewDialogClose");
>
> System.out.println("boolean: " + arg1);
>
> return Vote.APPROVE;
>
> }
>
> });
>
> windowActivite.open(window, dsl);
>
>
>
>
>
>
>
>
>
>
>
> ____________________________
>
> Manage your cellar
>
> Ma cave
>
>
>
>