AssociationListとNoWrapListのAddとRemoveが動作しない
AssociationListとNoWrapListのAddとRemoveが動作しません。
確認をお願いします。
こちらではテストしていて問題ないはずなのですが、テスト ケースを書いて送っていただけますでしょうか? よろしくお願いします。
以下では不十分でしょうか?追加削除の前後でもCountが変わりません。
alert("document.Config.Association.List.Coun = " + document.Config.Association.List.Count.toString()); document.Config.Association.List.Add("abcdef", true); alert("document.Config.Association.List.Coun = " + document.Config.Association.List.Count.toString()); document.Config.Save(); alert("document.Config.Association.List.Coun = " + document.Config.Association.List.Count.toString()); document.Config.Association.List.Remove(1); alert("document.Config.Association.List.Coun = " + document.Config.Association.List.Count.toString()); document.Config.Save(); alert("document.Config.Association.List.Coun = " + document.Config.Association.List.Count.toString()); alert("document.Config.NoWrap.List.Coun = " + document.Config.NoWrap.List.Count.toString()); document.Config.NoWrap.List.Add("abcdef", true); alert("document.Config.NoWrap.List.Coun = " + document.Config.NoWrap.List.Count.toString()); document.Config.Save(); alert("document.Config.NoWrap.List.Coun = " + document.Config.NoWrap.List.Count.toString()); document.Config.NoWrap.List.Remove(1); alert("document.Config.NoWrap.List.Coun = " + document.Config.NoWrap.List.Count.toString()); document.Config.Save(); alert("document.Config.NoWrap.List.Coun = " + document.Config.NoWrap.List.Count.toString());
Yutakaさんは書きました: こちらではテストしていて問題ないはずなのですが、テスト ケースを書いて送っていただけますでしょうか? よろしくお願いします。
次のように書いていただければ問題ないです。
cfg = document.Config; assoc = cfg.Association; list = assoc.List; alert( list.Count ); list.Add("abcdef", true); alert( list.Count ); list.Remove(1); alert( list.Count ); cfg.Save(); cfg = document.Config; nowrap = cfg.NoWrap; list = nowrap.List; alert( list.Count ); list.Add("abcdef", true); alert( list.Count ); list.Remove(1); alert( list.Count ); cfg.Save();
前のものが動かなかった理由がよく分かりませんが、
示されたように、オブジェクトを一つづつたどって、
変数指定するようにするとうまくいきました。
ありがとうございます。
このトピックの投稿: 5