Hi David, I don't understand the Liftweb side of validation yet, will look into that longer email discussion later today.
About PHP, I don't like it as a language, which it is effective for the outcome but not a pleasure to be doing. About Zend Form, It has a concept of validators which you add to form elements. $element->addValidator(new Zend_Validate_Alnum()); http://framework.zend.com/manual/en/zend.validate.html http://framework.zend.com/manual/en/zend.validate.set.html http://framework.zend.com/manual/en/zend.validate.validator_chains.html http://framework.zend.com/manual/en/zend.validate.writing_validators.html Also decorators are a kind of wrapper form form elements which are stacked to add some html to them. http://framework.zend.com/manual/en/zend.form.standardDecorators.html http://framework.zend.com/manual/en/zend.form.decorators.html So if you wrap a form element with Zend_Form_Decorator_DtDdWrapper you get <dt></dt> <dd><fieldset id="subform"> <legend>User Information</legend> ...(form element here) </fieldset></dd> In Scala you have traits, maybe a decorator could be a trait since traits are stackable where the order of with statements is important. Something like this? new StringInput with DtDdDecorator with SomeOtherDecorator. Philip On Sep 23, 8:10 pm, "David Pollak" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 22, 2008 at 9:28 PM, philip <[EMAIL PROTECTED]> wrote: > > > Hi Thnx, > > > I think the validation is important as mostly a web app that I would > > build is forms, validation, database. > > > I generally use PHP Zend Framework due to the ability to outsource > > some work to reduce my workload as PHP programmers are cheap. > > You could take some ideas from its validation and form decorators. > > I just looked at the Zend form stuff. Semantically, it looks a whole lot > like the Lift stuff, except Lift doesn't have the Conditional. > > > > > > > However I can tell that Liftweb will increase my productivity much > > more so maybe it won't be necessary to get outsourced work for this > > part of website development. > > > Thanks, Philip > > > On Sep 22, 10:26 pm, Marius <[EMAIL PROTECTED]> wrote: > > > On Sep 22, 3:28 pm, philip <[EMAIL PROTECTED]> wrote: > > > > > Hi Marius, > > > > > Thanks for the great replys, I'll just focus on one area. > > > > > About the validation error messages, I mean more specifically can I > > > > have the error messages for each <input on the form. > > > > For example if someone types a phone number incorrect, but perhaps I > > > > have 10 fields in my form, I want the phone number to have a error > > > > message next to it. Also they got the post code wrong, so I need a > > > > error message next to it as well. > > > > See David's reply. Form validations is virtually non existent in lift > > > yet but hopefully soon enough. There is ongoing work in this area. > > > > > As I understand it, all error messages are lumped together into the > > > > one div and shown. > > > > The lift:msg built in snippet work based on id and you can associate > > > messages with id-s (see my example). lift:msgs renderes generic > > > messages that are not associated with any id. > > > > > > 1. How can I put validation error messages next to the fields > > > > > themselves? > > > > > Please see notices/error/warnings. For instance S.error("msgid", "an > > > > error") and int your page you can put: > > > > <lift:msg id="msgid" errorClass="error_class" > > > > warningClass="warning_class"/> anywhere ... probably near by your > > > > form field. > > > > > Thanks, Philip > > > > > On Sep 22, 5:08 pm, Marius <[EMAIL PROTECTED]> wrote: > > > > > > On Sep 22, 9:13 am, philip <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > > > > > I have some questions as I have been developing and reading > > examples. > > > > > > > 1. How can I put validation error messages next to the fields > > > > > > themselves? > > > > > > Please see notices/error/warnings. For instance S.error("msgid", "an > > > > > error") and int your page you can put: > > > > > > <lift:msg id="msgid" errorClass="error_class" > > > > > warningClass="warning_class"/> anywhere ... probably near by your > > > > > form field. > > > > > > > 2. Is there any example of use of the controller directory, I saw > > the > > > > > > directory in one example but no files in it. I understand from a > > > > > > previous email I read that controllers are not preferred as there > > may > > > > > > be many controls on a single page. > > > > > > Might be .. I'm not sure. But I never had to use them since function > > > > > bindings, DispathPf, LiftView ... brought everything I ever needed :D > > > > > > > 3. Why does stateful snippit have a dispatch but other snippits do > > > > > > not. Is there any other information about dispatch around? > > > > > > dispatch function is a nice way of invoking snippet functions with no > > > > > reflection. Since "stateless" snippets are not required to implement > > > > > any interface the snippets functions are invoked using reflection. > > > > > > > 4. For the DB, it is lazy loading? ie, if I navigate from one > > object > > > > > > to another does it query DB when I navigate down a mapped class to > > > > > > class relationship? > > > > > > > 5. Why do you use Can[] for some variables in examples and in other > > > > > > cases you do not. In particular in stateful snippet in example you > > do > > > > > > not use Can[] but in HellForm you do use Can[] when it is a normal > > > > > > snippet. > > > > > > Cans are just a cool way to express existence/non-existence of a > > > > > value. Often they are used to avoid null reference testing etc. A can > > > > > can be Empty or Full ... well there is also a Failure which is in > > fact > > > > > an Empty Can. > > > > > > > 6. Are Can's compatible with normal Scala Some None? > > > > > > there are implicit functions from converting a Can to/from Option. > > You > > > > > can also have Can(Some("asdfsdfg")) > > > > > > > 7. Why are the DB classes named as such, MappedString, > > > > > > MetaMegaProtoUser. Mapped makes sense, its mapped to the database > > > > > > right. Meta Mega Proto seems, complex, what does it mean? > > > > > > > 8. It seems I prefer bind method over having XML for form in the > > > > > > class. Does anyone have reasons for and against either method? > > > > > > Bind is the right way to generate dynamic content on top of your > > > > > template. I don't recommend using a lot of markup generated in Scala > > > > > code. This should be minimized and AFAIC bind is doing a really great > > > > > job. > > > > > > > Thanks, Philip > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Collaborative Task Managementhttp://much4.us > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
