当前位置: 代码迷 >> Web前端 >> 讯息拦截器(MessageInterceptors)
  详细解决方案

讯息拦截器(MessageInterceptors)

热度:102   发布时间:2012-10-29 10:03:53.0
消息拦截器(MessageInterceptors)
public class DeleteItemInterceptor {

[MessageInterceptor(type="com.bookstore.events.ShoppingCartDeleteEvent")]
public function interceptDeleteEvent (processor:MessageProcessor) : void {
        var listener:Function = function (event:CloseEvent) : void {
            if (event.detail == Alert.OK) {
                processor.proceed();
            }
          };     
          Alert.show("Do you really want to delete this item?", "Warning",
            Alert.OK | Alert.CANCEL, null, listener);
    }

}