Hi,

you can consider to access to checkout order not directly with a variable (i.e. coOrder or checkoutOrder) but using a Wicket IModel. Then you could initialize your panel using onInitialize method, when IModel contains the right CoOrder instance.

in WebPage, add modalwindow when page init:

modalWindow.setContent(new
CheckoutOrderModalWindow(coOrder.getOrderBillNo(), mwCheckout));

CheckoutOrderModalWindow class create code:

public class CheckoutOrderModalWindow extends Panel {

        public CheckoutOrderModalWindow(final CoOrder checkoutOrder, final
ModalWindow mwModalWindow) {

                super(mwModalWindow.getContentId());                            
                
                if (coOrder.getOrderOnline() == true) { //here throw 
nullpointexception
                        
                }

        }


}


Because in the page initialization, CoOrder has not been created, thus
leading to WebPage initialize null pointer error.

If I use ModalWindow with WebPage Mode, will not have this problem.

But ModalWindow with WebPage occur in different browser page display
problems, WebPage can not get value that changed by ModalWindow's Page.



-----
http://www.517wm.com
外卖订餐分享工具
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-use-lazy-initialize-ModalWindow-s-Panel-tp3854828p3854828.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to