192 CHAPTER 6 DECOUPLED NAVIGATION PATTERN For (Web server address)
192 CHAPTER 6 DECOUPLED NAVIGATION PATTERN For the event call nav.call, the new function is PopupDialogbox and it is defined as follows: function PopupDialogbox( common, state) { InjectHTML( common, state); document.getElementById( “showimage”).style.visibility = “visible”; document.getElementById( “title”).innerHTML = state.title; } The function PopupDialogbox is an adapter of the predefined pop-up box component. By using the function InjectHTML, you inject the text in the table cell destination, destContent. The first getElementById references the property visibility and is used to make the div HTML element appear. The second getElementById references the innerHTML property and is used to assign the title of the pop-up box. The title would be assigned in the common.complete function implementation. In the example, PopupDialogbox is a function defined in the HTML page itself. But there is no reason why the function could not be reused in different contexts whenever a pop-up box is necessary. Additionally, the PopupDialogbox function needs other cosmetic changes, such as orientation and size of the pop-up box, that are not illustrated. The changes are not illustrated because they are application specific and do not help explain the Decoupled Navigation pattern. Using HTML Components When I was writing the details of this pattern, I was reluctant to repeat content that was written E B V N in great detail in other books or websites. After all, providing a bunch of widgets and their explanations without going into great detail is a very bad idea. However, I also knew that the Presentation functionality requires the explanation of HTML components. My original idea was to spend pages and pages explaining some basic HTML components such as pop-up boxes, menus, and pop-up windows. So off I went to explore how other people were building these HTML components. During my exploration, I hit upon the website http:// www.dynamicdrive.com. At first I thought, interesting site and neat components. It did not have everything, but it was good. It was not until I had to start explaining how to create HTML components that I realized the brilliance of this website. I thought I would have to spend hours integrating a pop-up box into the Decoupled Navigation pattern, when in fact it required only 20 minutes. At that point, it hit me that the best way to explain the Presentation functionality was to explain how to integrate HTML components. But as my exploration continued, I learned that there were good HTML components and bad HTML components. So as part of the implementation of the Decoupled Navigation pattern, I want to explain a good HTML component site so that when you are exploring for your own HTML components, you will be able to gauge a good or bad HTML component. After all, you do not want to write your own pop-up box. It has been done often enough. Figure 6-19 is a snapshot of the http://www.dynamicdrive.com website, which lists the available HTML components for dynamic content.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.