TAILIEUCHUNG - Bắt đầu với IBM Websphere smash - p 32

292 Chapter 12 Client-Side Programming with the Dojo Toolkit Figure Database driver details The second process started when a data source is selected fetches the database schema. The schema service returns a ItemFileReadStore-formatted JSON data, which contains a hierarchical structure that is perfect for representing in a tree widget. The process flow should be predictable at this point. We define a new DataStore, fetch the data, and when received, the createSchemaTree function is called to generate the Tree widget. This function checks to see if there is already a tree defined from a previous data source and, if so, destroys it. Then it creates. | 292 Chapter 12 Client-Side Programming with the Dojo Toolkit Figure Database driver details The second process started when a data source is selected fetches the database schema. The schema service returns a itemFileReadstore-formatted JSON data which contains a hierarchical structure that is perfect for representing in a tree widget. The process flow should be predictable at this point. We define a new DataStore fetch the data and when received the createSchemaTree function is called to generate the Tree widget. This function checks to see if there is already a tree defined from a previous data source and if so destroys it. Then it creates a new Tree instance passing in the backing DataStore and setting up a handler for when a leaf node on the tree is clicked. Back in the load schema function the accordion container is advanced to show the schema tree to the user as seen in Figure as well as updating the contents of the SQL editor area with an informative message. - SDB21NST1 E D ALIAS J S MATERIALIZED QUERY TABLE STABLE kg ACT - @CATALOG @CL_SCHED 0 CUSTOMER DEPARTMENT gEMPLOYEE - gEMPMDC 0 EMPPROJACT - 0 EMP PHOTO Figure Database schema tree listing Notice the use of the onError function to report any errors that occur during this process. One common mistake would be to place a try catch around the entire fetch function. This typically does not do what you would think as the fetch is asynchronous and effectively returns Download from Table Selection and Running SQL 293 immediately. Any errors that occur happened within the context of the Deferred and therefore must be handled in the error path. Always use the appropriate error path also known as the errback path when dealing with Deferreds. Otherwise errors can occur that will otherwise go unreported even if there are try catch blocks surrounding the asynchronous function calls. Table Selection and Running SQL The rest of the application flows are essentially variations of what

TỪ KHÓA LIÊN QUAN
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.