Title: Need help for closing view Post by: rualatngua 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. Title: Re: Need help for closing view Post by: puremvc on June 04, 2008, 05:35:06 You want to confirm with the user and save twice?
And what does QuotationPanelCommand do? -=Cliff> Title: Re: Need help for closing view Post by: rualatngua on June 04, 2008, 07:50:04 You want to confirm with the user and save twice? 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. Title: Re: Need help for closing view Post by: puremvc 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> |