[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Strom
Ok, I've made an in depth article on the wiki for this: http://wiki.github.com/dpp/liftweb/how-to-make-radio-lists-and-drop-downs-from-enumerations Let me know if I'm missing anything. Strom On Oct 28, 5:53 pm, Naftoli Gugenheim wrote: > The wiki on GitHub. You probably only need a GitHub accou

[Lift] Re: Proposal : Lift ticketing system

2009-10-28 Thread Derek Chen-Becker
I had actually thought about the upgrade paths for DB schemas and I was thinking of coding up a schema executor that would store a schema version in the db and could then be used to apply appropriate "diff" or "clean" schemas against the DB as needed. I think schemifier generally does a very good j

[Lift] Re: Get the subfolders and all the files in the Directory in the Lift ?

2009-10-28 Thread David Pollak
The best you can hope for is to try to access the ServletContext: http://tomcat.apache.org/tomcat-5.5-doc/servletapi/index.html Specifically, the getResourcePaths call: http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContext.html#getResourcePaths%28java.lang.String%29 On

[Lift] Get the subfolders and all the files in the Directory in the Lift ?

2009-10-28 Thread Neil.Lv
Hi all, I have a silly question about the directory. How can i get the subfolders and all the files in the specify directory, such as /images . I want to use the Dtree to show these files and folders . Thanks for any suggestion ! :) Cheers, Neil --~--~-~--~~

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Naftoli Gugenheim
The wiki on GitHub. You probably only need a GitHub account. - Strom wrote: I would post on the wiki, but I've never added content to a wiki, and I can't create an account for the LiftWiki (only admins can make new accounts?). If someone wants to post this in

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Strom
I would post on the wiki, but I've never added content to a wiki, and I can't create an account for the LiftWiki (only admins can make new accounts?). If someone wants to post this information on there somewhere, go for it! Strom On Oct 28, 5:39 pm, Ross Mellgren wrote: > +1  --  nice detailed

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Ross Mellgren
+1 -- nice detailed writeup -Ross On Oct 28, 2009, at 8:38 PM, Naftoli Gugenheim wrote: > > Why not put it on the wiki? :) > > - > Strom wrote: > > > Thanks again Ross! > > I also found out that I could use the ChoiceHolder.toForm method for a > little less

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Naftoli Gugenheim
Why not put it on the wiki? :) - Strom wrote: Thanks again Ross! I also found out that I could use the ChoiceHolder.toForm method for a little less customization (saves a ton of code though). The following rundown is for newbies like me who are having troub

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Strom
Thanks again Ross! I also found out that I could use the ChoiceHolder.toForm method for a little less customization (saves a ton of code though). The following rundown is for newbies like me who are having trouble with radio buttons and enumerations. Please see the enumeration definition in my f

[Lift] Re: path based and hostname based UrlRewriting interacting badly

2009-10-28 Thread David Pollak
It's a bug. Please open a ticket for it. I'll get it fixed tonight. On Wed, Oct 28, 2009 at 11:03 AM, harryh wrote: > > First, I rewrite URLs like /user/harryh to /user?uid=harryh > Also, requests to http://m.harryh.org/foo/bar get rewritten to / > subdomain/mobile/foo/bar > > Doing this with

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Ross Mellgren
(untested, uncompiled, and generally just a suggestion ;-) ) XHTML: var exchangeMethod: Box[ExchangeMethod.Value] = Empty bind("item", xhtml", "exchangeMethod" -> { (ns: NodeSeq) => (SHtml.radio(ExchangeMethod.elements.map(_.toString).toList, exc

[Lift] Re: Proposal : Lift ticketing system

2009-10-28 Thread Naftoli Gugenheim
I hear that. Personally I think it would be more maintainable, not less; there's just a bit more upfront complexity, although it's something I've already done and I can share my code. You could trivially have flexible user-defined fields. In my project you can edit the fields and the lookup tab

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Strom
Hey Ross. Thanks for the tips. I found out you have to call the toList () method before you can map the enumeration elements. So it would be like this: XTHML: Snippet: def SnippetName(xhtml:NodeSeq): NodeSeq = { var exchangeMethod: Box[ExchangeMethod.Value] = Empty ... bind("item", xhtml,

[Lift] Re: Proposal : Lift ticketing system

2009-10-28 Thread Derek Chen-Becker
The goal is to have a system that we can use for Lift's issue tracking. I don't know that it has to be as big and bad as, say, JIRA, but it needs to work well, have a reasonable set of features, and be usable by other people if they want it. I'm open to suggestions on architecture, but at this poin

[Lift] Re: Register new StatefulSnippet

2009-10-28 Thread Naftoli Gugenheim
Thanks. I greatly appreciate it. - David Pollak wrote: I opened a ticket for this. I'll expose functionality so you can register stateful snippets as part of the request process. On Sun, Oct 25, 2009 at 1:09 PM, Naftoli Gugenheim wrote: > > This may be more

[Lift] Re: Proposal : Lift ticketing system

2009-10-28 Thread Naftoli Gugenheim
What is the goal of this system? Is it to be a nice, useful ticketing system that will serve as a demo to Lift? Or is it also to be a product that will eventually compete with other issue trackers such as Lift? If you're thinking big then I would suggest to think in terms of flexibility and ext

[Lift] Re: Binding enumerations with radio buttons or select list

2009-10-28 Thread Ross Mellgren
SHtml.selectObj[ExchangeMethod.Value](ExchangeMethod.elements.map(el => (el, el.toString)), Empty, selected => println(selected)) ? -Ross On Oct 28, 2009, at 2:59 PM, Strom wrote: > > Has anyone figure out how to bind enumerations as radio buttons or a > drop down list? > > I have an enumera

[Lift] Binding enumerations with radio buttons or select list

2009-10-28 Thread Strom
Has anyone figure out how to bind enumerations as radio buttons or a drop down list? I have an enumeration: object ExchangeMethod extends Enumeration { val Pickup = Value("Pickup") val Ship = Value("Ship") val PickupOrShip = Value("Pickup or Ship") } And I want to put radio buttons in an h

[Lift] path based and hostname based UrlRewriting interacting badly

2009-10-28 Thread harryh
First, I rewrite URLs like /user/harryh to /user?uid=harryh Also, requests to http://m.harryh.org/foo/bar get rewritten to / subdomain/mobile/foo/bar Doing this with the following code: val urlRewriter: LiftRules.RewritePF = NamedPF("URLRewrite") { case RewriteRequest(ParsePath("user" :: uid :

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread David Pollak
On Wed, Oct 28, 2009 at 9:21 AM, David Pollak wrote: > Yeah, the signatures are convuluted... gotta change them to > FactoryMaker[Boolean] rather than FactoryMaker[() => Boolean] See http://github.com/dpp/liftweb/issues/#issue/141 > > > > On Wed, Oct 28, 2009 at 8:34 AM, Ross Mellgren wrote:

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread David Pollak
Yeah, the signatures are convuluted... gotta change them to FactoryMaker[Boolean] rather than FactoryMaker[() => Boolean] On Wed, Oct 28, 2009 at 8:34 AM, Ross Mellgren wrote: > > I had to slog through some factory maker stuff recently. What I found > out was that it was amazingly flexible, but

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread Ross Mellgren
I had to slog through some factory maker stuff recently. What I found out was that it was amazingly flexible, but that made the simple case non-obvious. For the simple case (set site-wide), the way I found to to do it was factory.default(() => defaultValue) e.g. LiftRules.stripComments.de

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread Timothy Perrett
Perhaps David can shed more light on it... I didn't write the strip comments stuff nor the FactoryMaker stuff and David has yet to detail how that stuff actually works or when it should be used. To that end, I can see the issue here and don't disagree. Cheers, Tim On 28 Oct 2009, at 15:20,

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread Yousry Abdallah
I downloaded the library source yesterday and stumbled on the (abstract) factory pattern in the LiftRules Class. Do you think this is the desired way to change a parameter? Sometimes you use simple assignment: LiftRules.useXhtmlMimeType = false or you apply a value: LiftRules.setSiteMap(...)

[Lift] Newbie problem: MenuWidget does not display deeper menu elements

2009-10-28 Thread vytasab
The lift-modules/lift-widgets test Boot.scala contains menu entries: val entries = Menu(Loc("Home", List("index"), "Home"), Menu(Loc("submenu1", List("submenu1"), "submenu1")), Menu(Loc("submenu2", List("submenu2"), "submenu2")), Menu(Loc("submenu3", List("sub

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread Timothy Perrett
Looking at the definition: val stripComments: FactoryMaker[() => Boolean] = new FactoryMaker(() => {() => { if (Props.devMode) false else true }}) {} try doing: LiftRules.stripComments(false){} Cheers, Tim On 28 Oct 2009, at 13:22, Yousry Abdallah wrote

[Lift] Re: global exception page

2009-10-28 Thread Jack Widman
Yes. Thanks alot Tim. On Wed, Oct 28, 2009 at 9:32 AM, Timothy Perrett wrote: > > Jack, > > LiftRules.exceptionHandler.prepend { > case (Props.RunModes.Production, r, e) => { > Log.error("IMPORTANT IMPORTANT IMPORTANT: Unhandeled error > occoured!!",e) > // your LiftResp

[Lift] Re: Changes in 1.1 production mode?

2009-10-28 Thread Yousry Abdallah
LiftRules.stripComments(false) generates following error message: Boot.scala:61: error: wrong number of arguments for method apply: ()() => Boolean in trait Vendor LiftRules.stripComments(false) On 27 Okt., 16:52, David Pollak wrote: > Please see LiftRules.stripComments. > > You can do Li

[Lift] Re: global exception page

2009-10-28 Thread Timothy Perrett
Jack, LiftRules.exceptionHandler.prepend { case (Props.RunModes.Production, r, e) => { Log.error("IMPORTANT IMPORTANT IMPORTANT: Unhandeled error occoured!!",e) // your LiftResponse here RedirectResponse("/error") } } Does that clear it up for

[Lift] global exception page

2009-10-28 Thread jack
I would like to have one error page that appears when any exception occurs. How would I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.

[Lift] Re: Possible bug in xml to json conversion

2009-10-28 Thread Joni Freeman
Hi Jonathan, Current toJson conversion does not support this case very well. The transformation rule is such that from each leaf XML element a JSON field is generated. foo -> "stats":"foo" And if that leaf element contains attributes we do not convert it automatically to JSON object as you expe

[Lift] Possible bug in xml to json conversion

2009-10-28 Thread Jonathan Ferguson
Depending on the structure of the XML, attributes and child elements are being lost. This can be seen in example 4, where the attribute expiry_date and the child element status have been dropped. It would also appear when XML is being converted to JSON attributes are being flattened to elements.