0

I have a parsley popup that can create another popup.

The issue comes when I close the root popup, when I open the popup again and click on the child popup, it's actually opening 2 child popups.

Any idea why this thing happen?

I have already make the reuse='false' and the modal = 'true' for both root and child popup.

Root

    <parsley:PopUp open="{presenter.scenarioCreatePopup}" modal="true"  center="true" reuse="false" id="hem" >
        <views:ScenarioView width="100%" height="100%" id="scenarioView"/>
    </parsley:PopUp>
</fx:Declarations>

Child ( ScenarioView )

<fx:Declarations>

    <parsley:Configure />

    <parsley:PopUp open="{templatePresenter.showTemplatePopup}" modal="true" reuse="false" center="true">
        <views:TemplateView width="100%" height="100%" id="templateView"/>
    </parsley:PopUp>

    <parsley:PopUp open="{tpPresenter.portfolioCreatePopup}" modal="true" reuse="false" center="true">
        <views:PortfolioSetupTitleView id="portfolioSetupTitleView"/>
    </parsley:PopUp>

</fx:Declarations>
Rudy
  • 7,008
  • 12
  • 50
  • 85
  • Wouldn't you want to do reuse=true? Also, where's the code that opens the second popup? Good chance you aren't cleaning it. – J_A_X Jul 07 '11 at 20:30
  • I added the child code. I decided to use reuse=false because I want to code to create new instance every time(and do not need to handle the state issue) – Rudy Jul 08 '11 at 03:06
  • debug trace the systemManager.popUpChildren of the root after the creation of the children. – Nate Jul 08 '11 at 05:03
  • I changed the reuse='true'(both root and child) and now it's working normally. I don't even have the state issue that I feared about. But I still don't understand what actually happened here. – Rudy Jul 08 '11 at 06:09
  • Hi J_A_X please answer so I can accept your answer. – Rudy Jul 08 '11 at 10:11
  • reuse prevented an inherit error with your state code. – J_A_X Jul 08 '11 at 13:57

1 Answers1

1

I believe that the problem here is that when you close your popup, you're not setting the open binded property to false. I think there's an inherit problem with the state of your system is in when opening again.

It's also probably not a good idea to have this kind of 'hiearchical' popups. It's bad UX to start with, and will make your popups go in an awry state. If anything, have all the popup declarations in your root and bind to their open property.

J_A_X
  • 12,857
  • 1
  • 25
  • 31