1 Reply Latest reply on Feb 2, 2010 11:47 PM by frszilinski

    CairngormCommand -> EventHandler -> ExternalInterface -> HTMLPopup -> window.opener == null !!!

    frszilinski Level 1


      I stumbled over a strange behavior... First I thought it's the PopUpBlocker


      I successfully implemented the payPalFlex solution. Only difference is, that I need to create a OrderHeader Entity before calling the PayPal-PopUp Window.


      So if I cancel the PayPal process and want to make the callback via. JavaScript to Flex (it's the onCancel part...)  the window.opener is null?! So I am already searching about 5 hours to find out what happened there. I think it's because I am not running in the main thread anymore.


      (I already tried to implement this with a changeWatcher and the Cairngorm successHandler Pattern...)


      Do you have a clue what's the Problem?




      some code out of my cart:

      // this gets called from button "Pay with PayPal"
      private function doPayWithPayPal(event:Event):void {
              // first create the OrderHeader
           var orderHeader:EOrderHeader = new EOrderHeader();
           orderHeader.id = 0;                    
           orderHeader.orderNumber = 0;               
           orderHeader.customerID = 0;                
           orderHeader.giftCodeID = 0;
           orderHeader.shipmentTypeID = 0;
           orderHeader.fulfillmentFlag = 'F';
           orderHeader.dateOrderDate = new Date();          
           orderHeader.orderTotal = sumOrder;
              // dispatch event to create orderHeader on Server
           var orderHeaderEvent:OrderHeaderEvent = new OrderHeaderEvent(OrderHeaderEvent.SAVE_ORDER_HEADER);
           orderHeaderEvent.orderHeader = orderHeader;
              orderHeaderEvent.successHandler = orderHeaderSaved;
      protected function orderHeaderSaved():void {
           if( AdminModel.getInstance().returnedOrderHeader == null ) {
           var orderID:Number = AdminModel.getInstance().returnedOrderHeader.id;
           var requestURL:String = "remote/payPalFlex/startPaymentFlex.php";
                'myWindow','height=500,width=900,toolbar=no,scrollbars=yes' );
           var url:URLRequest = new URLRequest("remote/payPalFlex/startPaymentFlex.php");
           url.data = new URLVariables();
           var obj:URLVariables = new URLVariables();
           url.data.useAs = orderID; 
           url.method = "GET";


      in cancle.php:

      <title>PayPal PHP API Response</title>
      <script type="text/javascript">
           function doCancel() {
        You canceled, close to go back to the shop blablabl...
      <a href="javascript:doCancel()">ZurŸck zum Shop</a>