showModalDialog で呼び出し元にアクセス

  呼び出し元



※ IE でしか動作しないので、VBScript で記述していますが、JavaScript でも同様です

  
Function SelectTables()

	Dim Ret

	Ret = window.showModalDialog( _
	"tables.htm" , _
	window, _
	"dialogWidth:600px;dialogHeight:500px;help:no;unadorned:yes;edge:sunken" _
	 )

	if Ret <> "" then
		document.all("Tables").value = Ret
	end if

End Function
  

window オブジェクトを第2引数として引き渡しています




  呼び出し先



window.dialogArguments で、呼び出し元の windows オブジェクトを取り出しています

  
function LoadTables()

	Dim win

	Set win = window.dialogArguments

	Call win.Ora( _
		win.document.all("Dsn").value, _
		win.document.all("User").value, _
		win.document.all("Password").value _
	 )

	if not win.Ora.Connect() then
		alert("接続に失敗しました")
		window.close
		Exit Function
	end if

	Dim Query

	document.all("ListTarget").length = 0
	Query = "select * from USER_TABLES order by TABLE_NAME"
	if not win.Ora.Query( Query ) then
		Call win.Ora.DisConnect()
		alert("読み出しに失敗しました" )
		window.close
		Exit Function
	end if

	Do while not win.Ora.Rs.EOF
		document.all("ListTarget").options.length = _
			document.all("ListTarget").options.length + 1
		document.all("ListTarget").options( _
			document.all("ListTarget").length-1 _
			).text = _
			win.Ora.Rs.Fields( "TABLE_NAME" ).value
		win.Ora.Rs.MoveNext()
	Loop

	Call win.Ora.DisConnect()

end function
  



  戻り値

  
function DialogEnd()

	window.returnValue = "戻り値"
	window.close

end function
  



  ダイアログで送ったフォームデータをダイアログで取得するには

フォームを記述した URL をトップとしてダイアログに表示する場合には
ダイアログのヘッド部に以下の記述を行います

  
<BASE target="_self">
  

トップにフレームを表示する場合はその必要はありません( 通常通り )










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ