ViewLogic: attachTo()

ViewLogicAlierView に取り付けます。

構文

ViewLogic.attachTo(containerToBeAttached, newHost) => ViewLogic | null

引数

  • containerToBeAttached: ViewLogic

    取り付ける対象の ViewLogic です。

  • newHost: AlierView

    containerToBeAttached の取り付け先の AlierView です。

返値: ViewLogic | null

引数 newHost に既に ViewLogic が取り付けられている場合はその ViewLogic です。取り付けられていなかった場合は null が返されます。

例外

  • TypeError
    • 引数 containerToBeAttachedViewLogic でなかった場合
    • 引数 newHostAlierView でなかった場合

解説

この関数の呼び出しは newHost.attach(containerToBeAttached) と等価です。

メッセージ

メッセージの概要についてはメッセージパッシングを、他のメッセージについては ViewLogic の状態変更を通知するメッセージを参照してください

このメソッド呼び出しでは containerToBeAttached に以下のようなメッセージが送出されます:

  • id: "vl$attached"
  • param: { target, newHost }
    • target: ViewLogic --- 変更された ViewLogic 自身
    • newHost: AlierView --- 新たに host に設定された AlierView
  • origin: ViewLogic
  • target: ViewLogic

このメッセージは newHost.attach() でも送出されます。