模型粘合事件处理程序中的流程

时间:2013-03-06 18:04:50

标签: coldfusion cfml model-glue

任何身体都可以帮助我理解模型 - 胶水事件处理程序的流程......它如此令人困惑或简化下面的代码......

  <event-handler name="Shipment.List" type="templatedPage">
        <broadcasts>
            <message name="needShipmentList" />
        </broadcasts>
        <views>
            <include name="Primary" template="List.Shipment.cfm">
                <value name="xe_Display" value="Shipment.Display" />
                <value name="xe_Form" value="Shipment.Form" />
            </include>
        </views>
    </event-handler>

    <event-handler name="Shipment.Display" type="templatedPage">
        <broadcasts>
            <message name="needShipmentDetail" />
        </broadcasts>
        <views>
            <include name="primary" template="Display.Shipment.cfm">
                <value name="xe_ShipmentList" value="Shipment.List" />
                <value name="xe_ItemForm" value="Item.Form" />
                <value name="xe_ShipmentDisplay" value="Shipment.Display" />
                <value name="xe_ItemRemove" value="doItem.Remove" />
            </include>
        </views>
    </event-handler>

1 个答案:

答案 0 :(得分:1)

当您调用事件“Shipment.List”时,它将广播ShipmentController的"needShipmentList"函数,执行后它将从主页的“Primary”布局返回List.Shipment.cfm

  • “List.Shipment.cfm”为needShipmentDetail函数触发了一个链接whicj
  • “List.Shipment.cfm”来自"Shipment.Display"-->needShipmentDetail
  • 的值
  • 在显示页面(Display.Shipment.cfm)上,有一些链接可供删除,列出......等等。
  • "xe"是eXit Events的惯例