Popup: Close a Popup correctly?

As the topic sais i got a problem with closing popups.

… as usual something like, nifty.gotoscreen(“start”) first.
Screen appears
Hit end button, exitPopup appears
Hit close popup button, popup disapear

Cant click any button on screen anymore.

[java]
public void exit() {
// creates a new popup with 2 buttons, yes,no, and shows it
app.setPopupElement2(app.getNifty().createPopupWithId(“popupExit”, “popupExit”));
app.getNifty().showPopup(app.getNifty().getCurrentScreen(), app.getPopupElement2().getId(), null);
}
[/java]

[java]
public void popupExit(String action) {
// yes-button destroys application, no-button closes popupExit
System.out.println("Popup: " + action);
if (action.matches(“yes”)) {
System.out.println(“StartScreenState Stop Called”);
app.stop();
} else if (action.matches(“no”){
app.getNifty().findPopupByName(“popupExit”).markForRemoval();
System.out.println("CS: "+app.getNifty().getCurrentScreen().getScreenId());
}
}
[/java]

closePopup() works, but effect endScreen doesnt get performed
java]
app.getNifty().closePopup(“popupExit”);
[/java]

markForRemoval() effect endScreen gets performed, but cant click on main screen (lower layer) anymore.
[java]
app.getNifty().findPopupByName(“popupExit”).markForRemoval();
[/java]

idea what iam doing wrong or what i have to look for (active screen, inputlistener or controlle?)
how to check how the click is handled, and who recives the mouse event.

maybe someone can extend the popup wiki ?

popup wiki link

got an time issue, cant correct the upper post anymore:

closePopup() works, but effect endScreen doesnt get performed.
[java] app.getNifty().closePopup(“popupExit”); [/java]

markForRemoval() effect endScreen gets performed, but cant click on main screen (lower layer) anymore.

[java]
app.getNifty().findPopupByName(“popupExit”).markForRemoval();
[/java]

idea what iam doing wrong or what i have to look for (active screen, inputlistener or controller?)
how to check how the click is handled, and who recives the mouse event.

Correction if I use closePopup(), the endScreen is getting perfomed.

what was irritating is that it seems the onclick methode is not executet.
Infact I can not hear the click if I close the popup.

[java]
<!-- opens a popup to exit the game -->
<popup id=“popupExit” controller=“com.example.game.StartScreenState” childLayout=“center” backgroundColor="#0001" >
<effect>
<onStartScreen name=“fade” start="#0" end="#a" length=“400” inherit=“true”/>
<onEndScreen name=“fade” start="#a" end="#0" length=“400” startDelay=“100” inherit=“true”/>
</effect>
<panel style=“nifty-panel” childLayout=“center” height=“50%” width=“50%” align=“center” valign=“center”>
<panel childLayout=“vertical” align=“center” valign=“center”>
<panel childLayout=“center” height=“50%” width=“100%”>
<image filename=“Interface/popupExitInfo.png” name=“popupExitInfo” label=“popupExitInfo” id=“popupExitInfo” height=“100%” width=“100%” align=“center” >
</image>
</panel>
<panel childLayout=“center” height=“25%” width=“100%”>
</panel>
<panel childLayout=“horizontal” height=“25%” align=“center”>
<panel childLayout=“center” height=“100%” width=“50%”>
<image filename=“Interface/spielBeenden.png” name=“exitSpielBeenden” label=“exitSpielBeenden” id=“exitSpielBeenden” height=“75%” width=“75%” align=“center” >
<interact onClick=“popupExit(yes)” />
<effect>
<onClick name=“playSound” sound=“myclick”/>
</effect>
</image>
</panel>
<panel childLayout=“center” height=“100%” width=“50%”>
<image filename=“Interface/weiter.png” name=“exitWeiter” label=“exitWeiter” id=“exitWeiter” height=“75%” width=“75%” align=“center” >
<interact onClick=“popupExit(no)” />
<effect>
<onClick name=“playSound” sound=“myclick”/>
</effect>
</image>
</panel>
</panel>
</panel>
</panel>
</popup>
[/java]