Library Development with YUI, Example 1

Show raw 'loading' panel

Show my own 'loading' component

In this example we are showing a 'Loading ... ' panel in one of two ways. In response to the first button, we build the panel on the fly and use it. In response to the second, we build our own custom 'Loading ...' object which inherits from Panel

While in the first example we have to deal with all the details of building and setting up the panel, which in a more complex object could be quite involved, in the second case, all details of the panel itself are encapsulated in the constructor of our custom panel so that all that remains to do is to create the custom 'Loading ...' panel, show it and, when required, hide it.