|
introduction get started articles manual tutorials reference docs case studies knowledge base goodies screenshots demos echoes Carousel zone home forums downloads bugs mailing list |
XUI Zone - goodies
Simple wizard navigator This simple library allows you to declare the pages of a wizard application in your static XML datasets. This method of updating the XML to process new pages makes it much easier to build and maintain applications which depend on this type of navigation. Please remember that, as with most aspects of XUI development, if this library does not do exactly what you want it to do, you can extend it to process custom behaviour. In order to start with the navigator you need to declare the pages which will be included in the wizard and this is shown in Listing 1.
Listing 1 - The navigation dataset in navigation.xml
This dataset file needs to be referenced from the datasources file referred to from the ModelData startup property as shown in Listing 2.
Listing 2 - The datasources file
As you can see from Listing 1 the navigation is setup with three pages; welcome, personal and bank. The welcome page is also setup in the startup properties as the StartClass. The other two pages need to be created in the pages directory. You can navigate through the pages of an application by calling the next and previous methods. These methods are static as the Navigator class is a Singleton. In this example the navPanel page has two button components declared as shown in Listing 3.
Listing 3 - The navPanel page
As you can see from this code, the static methods are specified as Library Functions in the method attributes of the Event tags. This will take care of the navigation for your application. If you wish to change the path to the model which contains your navigation pages you can do so by setting the NavModel startup property as shown in Listing 4.
Listing 4 - The NavModel startup property
In this library any exceptions are handled by the net.xoetrope.goodies.exceptions.ExceptionHandler class which loads a page called ErrorDlg to display errors and warnings. If you want to change the name of the default error reporting page you can do so by setting the ErrorDialogName startup property as shown in Listing 5.
Listing 5 - The default error dialog setting
Files
You need to be logged in to download the files for this article
comments If you were logged in you could rate this article or add a comment. |