Re: [Lift] Signup validation

2010-02-25 Thread Adam Warski
Hello, ticket created: http://www.assembla.com/spaces/liftweb/tickets/368 On Feb 24, 2010, at 6:28 PM, David Pollak wrote: On Wed, Feb 24, 2010 at 7:33 AM, Adam Warski a...@warski.org wrote: Hello, I'm integrating recaptcha into a Lift app that uses MegaProtoUser, and there's one

[Lift] Signup validation

2010-02-24 Thread Adam Warski
in concrete user classes. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email

Re: [Lift] Signup validation

2010-02-24 Thread Adam Warski
Hello, Can't you just override actionAfterSignup and don't call super if captcha check fails? But that already assumes that signup was successfull and in the end redirects to the homepage instead of going back to the singup form. -- Adam Warski http://www.warski.org http

Re: [Lift] Can I test Lift 2.0-M2 with Scala 2.0 Beta 1 now?

2010-02-16 Thread Adam Warski
Hello, Question - Can I test Lift 2.0-M2 with Scala 2.0 Beta 1 now? you need to use code from the 280_port_refresh branch (http://github.com/dpp/liftweb). The milestones are for 2.7.7 still. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message

Re: [Lift] Comet shutdown?

2010-02-10 Thread Adam Warski
= 0 ^ one error found same for timeSpan. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe

Re: [Lift] Re: Snippet with no reflection an no massive case statement

2010-02-10 Thread Adam Warski
using dispatch snippets. But why do you say to new users who just ask about statements from the wiki that their posts are time-wasting and that they can get less attention in the future I really don't understand. Peace :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu

Re: [Lift] Deploying Lift app

2010-02-10 Thread Adam Warski
think it should be enough to run mvn jetty:run in the background. My start-server.sh script: #!/bin/bash mvn jetty:run log.out 21 (puts all logs in log.out for further inspection) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you

Re: [Lift] Re: Snippet with no reflection an no massive case statement

2010-02-10 Thread Adam Warski
wondered about this sentence when I was starting to get to know lift. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com

Re: [Lift] Comet shutdown?

2010-02-10 Thread Adam Warski
As mentioned earlier, please try *lifespan* instead. def lifespan: Box[TimeSpan] is what you probably want. Ah :D I thought you were correcting the type parameter in David's email, didn't notice the function name. Thanks a lot! :) -- Adam Warski http://www.warski.org http

Re: [Lift] Re: Error messages are not displayed - 2.0-M1

2010-02-08 Thread Adam Warski
with snapshot and it works. Thanks Marius :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group

Re: [Lift] Re: Error messages are not displayed - 2.0-M1

2010-02-06 Thread Adam Warski
, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com

Re: [Lift] ProtoUser i18n

2010-02-02 Thread Adam Warski
Hmm right, although e.g. password already exists as a key and it wouldn't be good to duplicate it as Password. Same about Email. On Feb 2, 2010, at 1:08 PM, Jeppe Nejsum Madsen wrote: Adam Warski a...@warski.org writes: We'll accept a patch for this issue. Here's the patch. Note

Re: [Lift] ProtoUser i18n

2010-02-02 Thread Adam Warski
;) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr

Re: [Lift] ProtoUser i18n

2010-02-02 Thread Adam Warski
email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received

[Lift] ProtoUser i18n

2010-02-01 Thread Adam Warski
. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr

[Lift] NPE in MappedTextarea

2010-02-01 Thread Adam Warski
null = case s = s.toString}}/textarea)} } -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from

Re: [Lift] Re: Passing attributes to bound elements

2010-01-31 Thread Adam Warski
the child and apply the datepicker creation. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group

Re: [Lift] Re: Passing attributes to bound elements

2010-01-29 Thread Adam Warski
Hello, This was considered later on a defect, and not a feature. To preserve markup attributes in your bind use -% instead of - thanks, although the -% is missing support for the .toForm, as it returns a Box[NodeSeq]. And for % you need an Elem. Any ideas how to deal with that? :) -- Adam

[Lift] Lift + UTF-8

2010-01-29 Thread Adam Warski
- LiftRules.early.append(_.setCharacterEncoding(UTF-8)) When the String is set on the model field it still is correct, so something happens when trying to persist the value. Is there a way in lift to configure jdbc so that it accepts utf-8 characters? Or am I missing something else? -- Adam Warski http

Re: [Lift] Lift + UTF-8

2010-01-29 Thread Adam Warski
Heh, sorry, I knew the moment I write a post here I'll find the answer ;) Forgot that when converting a table in mysql you not only need to set the character encoding for the table but also for the individual columns. Sorry again for the spam. On Jan 29, 2010, at 3:01 PM, Adam Warski wrote

Re: [Lift] Re: Lift logging improvements

2010-01-28 Thread Adam Warski
...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email

[Lift] Loc hidden if type parameter is Unit and default value is Empty

2010-01-28 Thread Adam Warski
with other type params (that is, not Unit), where the default value is Empty, and they are shown normally. Is this a bug, or expected behaviour for some reason? -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google

[Lift] Passing attributes to bound elements

2010-01-28 Thread Adam Warski
seem to work - no attributes get rendered on the resulting element. Is this still supported? (the only difference from the example is that I don't use e:id but my own prefix which I then bind to in my snippet) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received

Re: [Lift] Creating a path from a Loc

2010-01-27 Thread Adam Warski
Hello, If you need a String: (for { loc - SiteMap.findLoc(Login) path - loc.createDefaultPath } yield path.text) openOr / right, I could just convert it to text. That works, thanks :). -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received

Re: [Lift] What is purpose of RequestVar/StatefulSnipplet for forms?

2010-01-27 Thread Adam Warski
will be called again, and fresh variables will be created. So the values won't be retained. If you want to keep the values between updating and re-rendering, you need something more global, like a RequestVar or a StatefulSnippet. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You

Re: [Lift] Creating a path from a Loc

2010-01-27 Thread Adam Warski
:). But looking at MetaMegaProtoUser trait I now see that there's for example a loginPath val which I can simply use instead of lookuing up the loc. As well as some other useful functions :) -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you

[Lift] Creating a path from a Loc

2010-01-26 Thread Adam Warski
)).toOption which would be: def createDefaultPath: Option[String] = currentValue.flatMap(p = link.createPath(p)).toOption (btw., why is it Option here, not Box?) Then generating a link to the login page would simply be: SiteMap.findLoc(Login).open_!.createDefaultPath -- Adam Warski http

Re: [Lift] Creating a path from a Loc

2010-01-26 Thread Adam Warski
!) but unfortunately the compiler doesn't seem to recognize the fact that the type parameter for loc is the same as the one returned for loc.currentValue. -- Adam Warski http://www.warski.org http://www.softwaremill.eu -- You received this message because you are subscribed to the Google Groups Lift group

Re: [Lift] HTML table links

2010-01-25 Thread Adam Warski
Hello, table cellpadding=7px title=User summary thFirst Name/th thLast Name/th thHours Summary/th thWage/th lift:Users.list tr

Re: [Lift] Re: HTML table links

2010-01-25 Thread Adam Warski
Hello, Could you please point me, I can't find it. if you mean the lift book, it's here: http://groups.google.com/group/the-lift-book -- Adam -- You received this message because you are subscribed to the Google Groups Lift group. To post to this group, send email to

Re: [Lift] Re: Ajax forms and (multiple) submit buttons

2010-01-18 Thread Adam Warski
Hello, Right ... and it's not even a hack ... css is the right way of building layout not really the html. Putting buttons in the form ar giving this perception in the page doesn't mean that the button has to be physically in the form element (at least that's the way I see it.). actually I

Re: [Lift] Re: Ajax forms and (multiple) submit buttons

2010-01-16 Thread Adam Warski
Hello, Hmm yes I wondered if the order in which the functions are bound is significant, but my experiments showed that it's not simply a first bound, first called principle. So I don't quite get it yet why it doesn't work. We rely on JQuery (or other underlying library) to send the actual

Re: [Lift] Re: Ajax forms and (multiple) submit buttons

2010-01-15 Thread Adam Warski
. Thanks! Adam Most likely I'll commit it today in master as it was approved by review board. Br's, Marius On Jan 14, 9:53 am, Adam Warski a...@warski.org wrote: I would of course be very +1 to include the ajaxSubmit :). Thanks for the work. This looks a bit different to the button I

Re: [Lift] Re: Ajax forms and (multiple) submit buttons

2010-01-15 Thread Adam Warski
Hello, Oh yeah contextFuncBuider ... good catch. I'll update today. thanks :) 2. The button will work only with full ajax-forms right? So forms wrapped with ajaxForm(...)? My initial use-case was for adding some ajax buttons to normal forms (submitted with a normal http request), but I

Re: [Lift] Re: Ajax forms and (multiple) submit buttons

2010-01-15 Thread Adam Warski
I kinda doubt that as I tested with a bunch of form fields. In the ajax request the function ID of the ajax function was always the last in the parameters and functions are evaluated in canonical order (for the same owner). But I think you sent me your source code location and I need to look

Re: [Lift] Re: Ajax button + submitting a form

2010-01-13 Thread Adam Warski
multiple buttons for a ajax form ... this version of ajaxButton does just that. Can you please clarify your used case for for for those 3 steps? ... Br's, Marius On Jan 12, 4:20 pm, Adam Warski a...@warski.org wrote: Hello, this *almost* works :). I modified your code a bit and now I

Re: [Lift] Re: Ajax button + submitting a form

2010-01-13 Thread Adam Warski
Hello, Yes please a small app would be best. Please use 2.0-SNAPSHOT. Here it is: http://github.com/adamw/lift-ajax-submit-test/ Steps to reproduce: 1. checkout from git :) 2. run mvn jetty:run 3. go to http://localhost:8080 4. click add once 5. fill in the two fields with some values e.g.

Re: [Lift] Re: Ajax button + submitting a form

2010-01-13 Thread Adam Warski
room name bind room name set container name container set room name room Adam On Jan 13, 2010, at 10:13 AM, Adam Warski wrote: Hello, Yes please a small app would be best. Please use 2.0-SNAPSHOT. Here it is: http://github.com/adamw/lift-ajax-submit-test/ Steps to reproduce: 1

Re: [Lift] Ajax forms and (multiple) submit buttons

2010-01-13 Thread Adam Warski
I would of course be very +1 to include the ajaxSubmit :). Thanks for the work. This looks a bit different to the button I tried before, maybe you have a patch so that I can try it out on the test app? Adam On Jan 12, 2010, at 8:39 PM, Marius wrote: Dear all, Recently (and not only) there

Re: [Lift] Re: Ajax button + submitting a form

2010-01-12 Thread Adam Warski
RequestVar should be preserved due to contextFuncBuilde call. Please let me know if this works. If it does we should probably add it to SHtml. Br's, Marius On Jan 11, 10:54 pm, Adam Warski a...@warski.org wrote: Hello, trying the solution a bit more I came into another problem which I

Re: [Lift] Re: Ajax button + submitting a form

2010-01-11 Thread Adam Warski
(form_ID)).toJsCmd}delete/button Br's, Marius On Jan 10, 6:58 pm, Marius marius.dan...@gmail.com wrote: On Jan 10, 5:20 pm, Adam Warski a...@warski.org wrote: Hello, ajaxButton(Press me would ya'?, SHtml.submitAjaxForm (form_ID).toJsCmd, (some) = { do your stuff here }) Looking

Re: [Lift] Re: Ajax button + submitting a form

2010-01-11 Thread Adam Warski
Hello, However for some reason, when I click the button, in the callback I get a new elements RequestVar (so it's initialized to an initial value) and moreover, nothing gets redrawn on the page. What is also quite weird is that the RequestVar is re-initialized, but the snippet instance

Re: [Lift] Re: Ajax button + submitting a form

2010-01-11 Thread Adam Warski
Hello, I don't think you need a SessionVar. You can just capture the RequestVar's value in a local val and refer to that in the closure. Basically if I understand correctly, this is a typical scenario where you output a form and associate functions with its fields which are to be executed

Re: [Lift] Re: Ajax button + submitting a form

2010-01-11 Thread Adam Warski
list of input fields with add and delete operations :) Adam On Jan 11, 1:09 pm, Adam Warski a...@warski.org wrote: Hello, this almost works :). Right now in my form I have a hidden element where the type of the operation to execute will be set: input type=hidden id=operation_id name

Re: [Lift] Re: Ajax button + submitting a form

2010-01-10 Thread Adam Warski
., 10:48, Adam Warski a...@warski.org wrote: Hello, I have a regular form, which is submitted with a POST (no AJAX here yet). The form contains a list, to which you can add and remove elements using AJAX. So the add and remove buttons are: add - ajaxButton(Add element, () = { elements += new

Re: [Lift] Re: Ajax button + submitting a form

2010-01-10 Thread Adam Warski
buttons. Adam On Jan 10, 2010, at 10:42 AM, Adam Warski wrote: Hello, thanks, but my use-case is a bit different. I want the whole form to be still submitted using a POST (the normal way), and only use ajax for a small fragment of the page (the element editor). So I can't use ajaxForm

Re: [Lift] Re: Ajax button + submitting a form

2010-01-10 Thread Adam Warski
={SHtml.submitAjaxForm(form_ID).toJsCmd}blah/button Br's, Marius On Jan 10, 1:08 pm, Adam Warski a...@warski.org wrote: There is also a related problem: how can I have two ajax buttons on one form which submit the form and execute different functions on the server? Using the standard trick

Re: [Lift] Re: Ajax button + submitting a form

2010-01-10 Thread Adam Warski
Hello, ajaxButton(Press me would ya'?, SHtml.submitAjaxForm (form_ID).toJsCmd, (some) = { do your stuff here }) Looking at the source code I think this might work, but I'm having trouble constructing the correct expression to pass to ajaxButton. The method signature requires a Call

[Lift] Ajax button + submitting a form

2010-01-09 Thread Adam Warski
Hello, I have a regular form, which is submitted with a POST (no AJAX here yet). The form contains a list, to which you can add and remove elements using AJAX. So the add and remove buttons are: add - ajaxButton(Add element, () = { elements += new Element; reDraw }) The reDraw method is a

Re: [Lift] Re: Errors not shown after AJAX form submit

2010-01-05 Thread Adam Warski
any idea why my example application produces such weird results? I looked in the RequestVar code and didn't find anything there that would make it behave differently in the two scenarios. Adam Br's, Marius On Jan 5, 9:37 am, Adam Warski a...@warski.org wrote: Hello, Ah, I didn't spot

Re: [Lift] Re: Errors not shown after AJAX form submit

2010-01-05 Thread Adam Warski
/271 By the way, do you have any idea why my example application produces such weird results? I looked in the RequestVar code and didn't find anything there that would make it behave differently in the two scenarios. Adam Br's, Marius On Jan 5, 9:37 am, Adam Warski

[Lift] Errors not shown after AJAX form submit

2010-01-04 Thread Adam Warski
Hello, investigating further making the tutorial form submittable with ajax, I found some weird behavior; I'm using 1.1-M8. It seems that when the form is submitted with ajax, and there are form validation errors, the error is not shown. However, the notices work fine. So: - S.notice(Added

Re: [Lift] Errors not shown after AJAX form submit

2010-01-04 Thread Adam Warski
net.liftweb.builtin.snippet.Msg for a better example) Hope that helps, -Ross On Jan 4, 2010, at 3:10 PM, Adam Warski wrote: Hello, investigating further making the tutorial form submittable with ajax, I found some weird behavior; I'm using 1.1-M8. It seems that when the form

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, Well for changing the tutorial form into an ajax form I guess the best solution is to store the model instance in a RequestVar and simply set it to a new instance after saving. So I don't have any immediate use-cases. But in other (Seam) projects I remember that I used the event

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, That's true in practice. The implementation of those methods however are equivalent to the S and SHtml versions except for the call to registerThisSnippet. But if Lift will sometimes remember even ordinary class instances as reusable snippets then why should the API for managing

Re: [Lift] Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, Yes, the article is out of date now... Lift now makes sure that multiple references to a single snippet in the same request context use the same instance of that snippet. I've updated the wiki page a bit: http://wiki.github.com/dpp/liftweb/about-snippets, if some lift gurus would

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, These are the names we use in Lift - appreciate what your saying, but its not confusing IMHO, just different to other things you are used to. Lift is Lift, not RoR, or Seam, or any other framework ;-) Sure, it's just a simple terminology switch, I don't really mind if they are named

[Lift] Snippet lifetime

2009-12-28 Thread Adam Warski
Hello, on the wiki page about reflection snippets (http://wiki.github.com/dpp/liftweb/about-snippets), it is written: Every time you call the reflection snippet in your markup code, a new instance is instantiated and the appropriate method invoked However this doesn't seem to be true (I'm

Re: [Lift] Snippet lifetime

2009-12-28 Thread Adam Warski
-scope variable? I saw that there's TransientRequestVar, but it's private in the liftweb package. Adam Cheers, Tim On 28 Dec 2009, at 14:33, Adam Warski wrote: Hello, on the wiki page about reflection snippets (http://wiki.github.com/dpp/liftweb/about-snippets), it is written: Every

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Adam Warski
once per request. Br's, Marius On Dec 28, 6:04 pm, Adam Warski a...@warski.org wrote: Hello, Yes, the article is out of date now... Lift now makes sure that multiple references to a single snippet in the same request context use the same instance of that snippet. I see, so

Re: [Lift] Snippet lifetime

2009-12-28 Thread Adam Warski
Yes, the article is out of date now... Lift now makes sure that multiple references to a single snippet in the same request context use the same instance of that snippet. I see, so the rationale behind using dispatch snippets is out of date also. Except that you save one reflection

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Adam Warski
Hello, 1) Can I have in lift a true request variable/snippet, that is such which has a lifetime of one request (without any ajax callbacks)? I can't use TransientRequestVar because it's private. It would be useful to complete my ajax-form example (after an item is saved, a new one should

Re: [Lift] Re: Duplicate divs in tutorial

2009-12-24 Thread Adam Warski
Heh, of course :) Can you (or somebody else) fix Listing 12 in the tutorial then? Adam On Dec 23, 2009, at 11:19 PM, Marius wrote: Why not something like: div id=all_todos lift:TD.list all_id=all_todos ... /lift:TD.list /div Br's, Marius On Dec 23, 11:46 pm, Adam Warski

[Lift] Beginner Ajax question - redrawing a page fragment

2009-12-23 Thread Adam Warski
Hello, I'm just starting with Lift, and there's one thing I can't figure out. I want to modify the ToDo example from the tutorial so that the Add button makes an ajax call, adds the element to a list and displays the modified result. The problem is that I don't know how to redraw the list

Re: [Lift] Re: Beginner Ajax question - redrawing a page fragment

2009-12-23 Thread Adam Warski
can't test it yet because I can't get my form to be submitted with ajax. Both surrounding the bind with SHtml.ajaxForm(...) and replacing submit with ajaxButton causes the form to stop working (the values in the model aren't updated). Adam Br's, Marius On Dec 23, 10:32 am, Adam Warski

Re: [Lift] Re: Beginner Ajax question - redrawing a page fragment

2009-12-23 Thread Adam Warski
Hello, object MyMarkupVar extends RequestVar[NodeSeq](NodeSeq.empty) ah, that's much better then my solution. Thanks! :) Maybe you could also write, how to submit a whole form using AJAX? :) So far my attempts are futile. I get an ajax request, but the value of the field isn't bound to the

Re: [Lift] Re: Beginner Ajax question - redrawing a page fragment

2009-12-23 Thread Adam Warski
Hello, A couple of observations... First, having some XHTML in your Scala code is not a bad thing. When the XHTML declares the meaning (not the layout) of the information, it's my opinion that it's okay. This means that: ul{list.map(i = li{i}/li}ul Simply defines an unordered list.