Đang chuẩn bị liên kết để tải về tài liệu:
Apress bắt đầu ứng dụng với java google - p 14

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Xử lý Client-Side Sự kiện Giống như hầu hết các ứng dụng dựa trên web, code của bạn thực hiện dựa trên sự tương tác của người dùng. Người sử dụng gây ra một số loại sự kiện, như một nút nhấn hoặc nhấn một phím, và ứng dụng của bạn phản ứng phù hợp bằng cách thực hiện một số hành động | CHAPTER 5 DEVELOPING YOUR APPLICATION table Running Your Application Click the Run button again to launch your application in hosted mode. It should look like Figure 5-5. Figure 5-5. Your newly designed application Handling Client-Side Events Like most web-based applications your code executes based on user interaction. The user triggers some kind of event such as a button click or a key press and your application responds accordingly by performing some action. It shouldn t be a surprise to discover that GWT handles events with the same event-handler interface model that you find in other user-interface frameworks. A widget announces or publishes an event for example clicking a button and other widgets subscribe to the event by receiving a particular event-handler interface and performing some action for example displaying a pop-up message . 108 CHAPTER 5 DEVELOPING YOUR APPLICATION Start by adding a click handler and an event listener for your Add Row button. You ll handle the Add Row button s click event by passing it an object that implements the ClickHandler interface. In the code below you ll see that we use an anonymous inner class to implement ClickHandler. The interface has one method onClick which fires when the user clicks the button and adds a new row to the FlexTable for a new time entry. listen for mouse events on the add new row button addRowButton.addClickHandler new ClickHandler public void onClick ClickEvent event addRow One of your functional requirements is to allow users to record the amount of time they worked based on a user-defined start date. With your date picker you ll listen for changes to the selected date based on the interface s onValueChanged method. When the widget detects a change to its date it sets the class variable to the widget s selected date renames the columns of the FlexTable based on the start date and displays the major visible components of the application. listen for the changes in the value of the date .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.