2011-08-16 12 views
7

私はiPadと互換性のあるWebアプリケーションを開発しています。iPad safari modalpopupの問題

私は、iOSバージョン3.2でテストしています。すべてのモーダルダイアログポップアップは親ウィンドウに値を返しています。しかし、私のiOSを4.3にアップグレードした後、それは奇妙な動作をしています。今、iPadでは値を返していますが、別のフィールドや同じフィールド(HTMLテキストフィールド)をクリックするまではフィールドを更新していません。

私はwindow.open()を使用してモーダルポップアップを開いています。

window.opener.oaEventiPad(retValArray)を使用して戻る。 oaEventiPadは、更新された値を設定する関数です。

誰でもお手伝いできますか?

ありがとう、

+0

おかげで –

+0

あなたがoaEventiPad()関数を使用してコードを投稿することができ、あなたのコードの多くを投稿してください?これはもう少し理解を深めるのに役立ちます。 – CaptainBli

答えて

0

私は同様の問題を抱えています。私はiPadと互換性があると考えられている私のASP .NETアプリケーションでwindow.openをポップアップして開きます。 IE、Chrome、FireFox、Safari(Windows 7搭載のPC)を使用すると、値が正常に返されました。

iPadからアプリケーションにアクセスすると残念ながら、同じコードがSafariで失敗します。 iPadの場合domObjectは、新しいウィンドウを閉じたときに返された値をプロンプトする代わりに、新しいウィンドウを開いたときにプロンプ​​トが表示されます。

以下はコードです。 親ウィンドウ:

enter code here 


<script type="text/javascript"> 

     function modalWin() { 
      //alert('clicked'); 
      if (window.showModalDialog) { 
       retVal = window.showModalDialog("About.aspx", "name", "dialogWidth:255px;dialogHeight:250px"); 
       alert(retVal); 
      } 
      else { 
       retVal = window.open('About.aspx', 'name', 'height=255,width=250,toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no ,modal=yes'); 
       alert(retVal); 
      } 

     } 
    </script> 
//HTML 
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> 
<a title="Test New Popup" onclick="modalWin();">New Popup for all browsers.</a>. 
</asp:Content> 

新しいページ:

 <script type="text/javascript"> 
     function closeIt(tempValue) { 
      window.returnValue = tempValue; 
      window.close(); 
     } 
    </script> 
//HTML: 
<input id="btnButton1" value="btnButton1" type="button" title="Press it to Close" onclick="closeIt('btnButton1');" /> 
    <br /> 
    <input id="btnButton2" value="btnButton2" type="button" title="Press it to Close" onclick="closeIt('btnButton2');" /> 
    <br /> 
    <input id="btnButton3" value="btnButton3" type="button" title="Press it to Close" onclick="closeIt('btnButton3');" />