|
From: Tim O'B. <ti...@gm...> - 2006-11-21 10:42:28
|
Thanks Nigel and Joshua, I see how it works now thanks. So most of my code has moved from UIModule subclass to the Chunk subclass now. And using the validate/events methods and the error array in the Chunk subclass makes things much easier. In practice does much code go into the UIModule subclass apart from the generated code? This is the Controller part of the MVC model right? Tim On 11/17/06, Nigel Kibodeaux <nig...@pa...> wrote: > 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 > > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Wasp-development mailing list > Was...@li... > https://lists.sourceforge.net/lists/listinfo/wasp-development > -- Please don't send confidential info to me at this address, thanks |