tailieunhanh - GWT in Practice phần 6

Có một số nhược điểm khác là tốt. Một trong những lớn là việc thực hiện SOAP Flash là khá mong manh. Nếu dịch vụ của bạn SOAP là mạnh mẽ và đã được biết đến để làm việc trên nhiều nền tảng (nói,, sau đó bạn sẽ có thể không chạy vào bất kỳ vấn đề. | 168 Chapter 6 Integrating Legacy and Third-Party Ajax Libraries common idiom for letting scripts overload the body element s onload event. Each time we want to add a closure we take the current one and hold it. Then in the next closure method we first call the original if needed and execute the current event. When the final closure is called we climb up to the top of the chain and execute each closure in turn. In this case each of them fires the onChange event of the listener they were created to handle. Now that we re supporting DragListeners we can modify the EntryPoint class to show that they are working. Listing shows the new listeners added to our draggable. Listing MyEntryPoint .onModuleLoad handling listeners public void onModuleLoad Button b new Button Make Draggable new ClickListener public void onClick Widget widget img null false 1000 null true img new DragListener public void onChange UIObject source new Label Listener 1 event. img new DragListener public void onChange UIObject source new Label Listener 2 event. _ b img .add panel Now when we drag the image around the window we ll see Labels that indicate events filling up the bottom of the screen as shown in figure . Because our daisy-chained closures call the previous closure first they execute in the order they were added. If for instance we wanted to allow one listener to consume the event and stop processing we could have the DragListener interface return a boolean indicating whether processing should continue. If any closure gets a false returned from its predecessor it simply returns false and exits. This is pretty useful functionality but we might want to do more with it than we currently are. Most importantly these events don t tell us what kind of event fired them meaning we don t know the difference between picking up moving and dropping. What we

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.