0

任何人都可以帮助我理解模型胶水事件处理程序的流程......它如此混乱或简化了下面的代码......

  <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>
4

1 回答 1

1

当您调用事件“Shipment.List”时,它将广播"needShipmentList"ShipmentController 的功能,执行后它将List.Shipment.cfm从母版页的“主要”布局返回。

  • “List.Shipment.cfm”有一个链接,触发needShipmentDetail函数
  • “List.Shipment.cfm”从"Shipment.Display"-->needShipmentDetail
  • 在显示页面(Display.Shipment.cfm)上,有一些链接用于删除、列出...等
  • "xe"是退出事件的约定
于 2013-03-07T05:23:01.673 回答