Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Need help for closing view  (Read 8139 times)
rualatngua
Newbie
*
Posts: 2


View Profile Email
« on: June 03, 2008, 11:55:59 »

Hi all!

I have an QuotationPanel view compose two view: QuotationHeader and QuotationLines. QuotationPanel is a tab in TabNavigator. When user edit in both of QuotationHeader and QuotationLines but not click Save button. Then user click close button tab, I need confirm that user want to save or not save before close. I think it should be in these step:

1. Notify QuotationPanel closing
2. Notify QuotationHeader closing and it should have these step
      Confirm save with user
      User confirm save
      Call proxy for close (send Asyn call to server and waiting for response)
      Handle save success notification. Then send #1. Close finish header
3. Notify QuotationLine closing
      Confirm save with user
      User confirm save
      Call proxy for close (send Asyn call to server and waiting for response)
      Handle save success notification. Then send #2. Close finish lines

The problem is  CloseQuotationPanelCommand need triggered by recieve two #1, #2 notify.

Anyone help me!

PS: sory my english not well to clearly explain.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: June 04, 2008, 05:35:06 »

You want to confirm with the user and save twice?

And what does QuotationPanelCommand do?

-=Cliff>
Logged
rualatngua
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: June 04, 2008, 07:50:04 »

You want to confirm with the user and save twice?

And what does QuotationPanelCommand do?

-=Cliff>

Yes, I want confirm user twice. CloseQuotationPanelCommand handle remove mediators and proxy for QuotationPanel, QuotationHeader and QuotationLine.

Provisional solution, in QuotationPanelMediator I check two Line and Header need to save. Then show confirm message. After user confirm YES, QuotationPanelMediator call LinesMediator.doSave() and HeaderMediator.doSave(). After all, PanelMediator send notify to trigger CloseQuotationPanelCommand.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: June 04, 2008, 10:23:08 »

Not sure about putting these doSave methods on header and lines mediators and having panel mediator call it. Sounds more like the work of a command to 'doSave'.

-=Cliff>
Logged
Pages: [1]
Print