|
From: Nigel K. <nig...@pa...> - 2006-11-16 17:36:19
|
Tim, The validation methods are in the Chunk class to so they can validate the inputs of that page/chunk. In your class that extends UIModule, you can construct the chunk (which will automatically check for errors using the validation methods you define for the inputs) then you can use the resulting error array from that chunk to decide which chunk to draw. When the appropriate chunk is selected, pass it as a parameter to the addContent() method of your class that extends UIModule. I hope that helps. It's been a while since I've used WASP, so if anyone else wants to clarify or correct me, please do. Nigel Tim O'Brien wrote: > Hi, > > I am using WASP for a project at the moment. Just wondering whether to > use the parameter validation methods. The problem is that the > validation methods are part of the Chunk class, so the page that is > going to displayed has been already chosen, therefore the validity of > the parameters cant change which page is going to displayed. > > For example, if you had a registration chunk/page with a form, and you > wanted to load the "congratulations you've registered" chunk/page if > all the form parameters are valid, and if not you would load the > registration page again, so they can correct the problem. > > or even to load an generic error page. > > Wouldnt it be better to have these validation methods in the UIModule class? > > > Cheers > Tim > > |