【ボタン型セル】 ボタン型セルが設定されたシート上で、コールバック後にreloadメソッドを呼び出すとIEが強制終了する
対象製品
SPREAD for ASP.NET 7.0J
状況
修正済み
詳細
ボタン型セルが設定されたシート上で、コールバック後にreloadメソッドを呼び出すとIEが強制終了します。この現象はiframe/frameに、SPREADを配置したaspxを使用すると発生します。
【再現コード】
------------------------------------
Webフォームクラス
------------------------------------
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Page.IsPostBack Then Return
FpSpread1.Sheets(0).Columns(0).CellType = New FarPoint.Web.Spread.ButtonCellType()
End Sub
------------------------------------
aspxファイル
------------------------------------
<input type="button" id="Button1" value="button" onclick="test_reload();" />
------------------------------------
クライアント側スクリプト
------------------------------------
function test_reload() {
var objSpread = document.getElementById("FpSpread1");
objSpread.CallBack("test");
window.location.reload();
}
【再現手順】
1.プロジェクトを起動します
2.標準のボタンコントロールをクリックします
-- IEが強制終了します
【再現コード】
------------------------------------
Webフォームクラス
------------------------------------
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Page.IsPostBack Then Return
FpSpread1.Sheets(0).Columns(0).CellType = New FarPoint.Web.Spread.ButtonCellType()
End Sub
------------------------------------
aspxファイル
------------------------------------
<input type="button" id="Button1" value="button" onclick="test_reload();" />
------------------------------------
クライアント側スクリプト
------------------------------------
function test_reload() {
var objSpread = document.getElementById("FpSpread1");
objSpread.CallBack("test");
window.location.reload();
}
【再現手順】
1.プロジェクトを起動します
2.標準のボタンコントロールをクリックします
-- IEが強制終了します
回避方法
Service Pack 3(v7.0.4017.2010)で修正済み。
Service Pack 3(v7.0.4017.2010)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
本現象はボタン型セルが不要なスクリプトファイルを参照していることにより発生しています。ボタン型セルを継承し、不要なスクリプトファイルを参照しないことで現象を回避できます。
------------------------------------
Webフォームクラス
------------------------------------
Partial Class Main2
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then Return
Dim ct As New MyButtonCelltype()
ct.ImageUrl = "image.png"
ct.ButtonType = FarPoint.Web.Spread.ButtonType.ImageButton
FpSpread1.Sheets(0).Columns(0).CellType = ct
End Sub
_
Class MyButtonCelltype
Inherits FarPoint.Web.Spread.ButtonCellType
Public Overrides ReadOnly Property RendererClientScriptUrl As String
Get
Return String.Empty
End Get
End Property
End Class
Service Pack 3(v7.0.4017.2010)より前のバージョンでは次の回避方法が有効です。
------------------------------------------
本現象はボタン型セルが不要なスクリプトファイルを参照していることにより発生しています。ボタン型セルを継承し、不要なスクリプトファイルを参照しないことで現象を回避できます。
------------------------------------
Webフォームクラス
------------------------------------
Partial Class Main2
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Page.IsPostBack Then Return
Dim ct As New MyButtonCelltype()
ct.ImageUrl = "image.png"
ct.ButtonType = FarPoint.Web.Spread.ButtonType.ImageButton
FpSpread1.Sheets(0).Columns(0).CellType = ct
End Sub
Class MyButtonCelltype
Inherits FarPoint.Web.Spread.ButtonCellType
Public Overrides ReadOnly Property RendererClientScriptUrl As String
Get
Return String.Empty
End Get
End Property
End Class