GithubHelp home page GithubHelp logo

lift-cookbook's People

Contributors

d6y avatar farmdawgnation avatar fbettag avatar fmpwizard avatar indexpro avatar janedallaway avatar jhosman avatar karaebrahim avatar mads-hartmann avatar marekzebrowski avatar pr1001 avatar sbradl avatar shadowfiend avatar tyoc213 avatar zofrex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lift-cookbook's Issues

Disqus support

I think it would be a great idea to use disqus to add comment support to each page to make it even easier for people to give feedback.

I don't mind implementing it and send a pull request to pamflet but I wanted to make sure that you guys also think it's a good idea before going forward :)

/Mads

Implementing a plain old fashioned form

Problem:

You want a regular HTML form and process the values on the server.

Solution:

Use StatefulSnippet and instance vars.

(insert example here)

Discussion:

Because... https://groups.google.com/forum/?fromgroups#!topic/liftweb/2pxQf4VMk-c and the links from it

RequestVars are good for sharing between snippets. Don't work for comet.
"The purpose of RequestVars is to share state across snippets during a single request. I advise against using RequestVars when snippet instance variables are available." (dpp in https://groups.google.com/forum/?fromgroups#!msg/liftweb/gTkrnu8588o/dxaKFPrI5y4J)

Mention Wizard as another useful way to handle simple form stuff?

See also

4.3 Stateful Snippets
http://simply.liftweb.net/index-4.3.html

4.4 RequestVars
http://simply.liftweb.net/index-4.4.html

Setting up JRebel

Problem: you want to see your site changes faster, using JRebel to reload your changes.

Solution:

pointer to JRebel site

changes to SBT start up and build.sbt

Discussion:

It's free for open source Scala devs.

lift-json java.lang.AbstractMethodError

All of the sudden you get java.lang.AbstractMethodError errors at runtime using lift-json. You also use dispatch

answer:

Dispatch uses lift-json internally, this results in having two different versions of lift-json in your classpath

If you are using sbt, enter this in your build.sbt

"net.databinder" %% "dispatch-lift-json" % dispatchVersion intransitive()

see also:

[enter new page for "Potentially incompatible versions of dependencies of {file:/.....i/}default-32219c:org.scala-lang: 2.9.1, 2.9.0-1"] warning when compiling your project

Loop over a collection using the same template for each item.

Problem: you have a list you want to display, using the same HTML template for each item in the list.

Solution:

.fields" #> (".label *" #> List("Cat", "Dog"))

for

<div class="fields">
 <div class="label">Field Label</div>
</div>

(or see wiki entry for example to use)

Discussion

Show case for label and description as per mailing list discussion.

See also:

http://groups.google.com/group/liftweb/browse_thread/thread/62d84c002161fc3/8a36a3ded9312270?lnk=gst&q=Binding+via+CSS+Selectors+and+iteration#8a36a3ded9312270

http://www.assembla.com/spaces/liftweb/wiki/Binding_via_CSS_Selectors

Create paragraphs from text input

You have text with new line characters and you want to replace them with br tags for display.

Solution: if pre doesn't do what you want use:

text.split("\n").toList flatMap { Text(_) ++ <br/> } init 

Discussion:

Possibly discuss Lift's escaping safety mechnism.

Possibly discuss \n vi \r\n
Textile also supports this, but produces valid html (i.e., body tags etc). I think. Check that

See:

http://groups.google.com/group/liftweb/browse_thread/thread/e678976b8f403a76/fa7eb01e137261f9?lnk=gst&q=paragraph+breaks#fa7eb01e137261f9

http://groups.google.com/group/liftweb/browse_thread/thread/c75e15409e681d78/b34d327c947cf364?lnk=gst&q=new+line+to#b34d327c947cf364

Autocomplete

Write up an example of Autocomplete

See mailing list: [Lift] Scala Lift AutoComplete

Developing Lift Apps using Eclipse

Problem:

You want to work with Eclipse, developing web applications, hitting refresh in your browser and see the changes.

Solution:

pointer to Scala IDE for Eclipse plugin.

sbt eclipse plugin

running Jetty in a shell window.

Discussion:

global v. per-project sbt config

better with JRebel

Setting up JRebel

Problem: you want to see your site changes faster, using JRebel to reload your changes.

Solution:

pointer to JRebel site

changes to SBT start up and build.sbt

Discussion:

It's free for open source Scala devs.

Trigger server-side Scala code from a button press

You want to trigger a function on the server from a button press.

Solution: SHtml.ajaxInvoke

Discussion: explain signature of ajaxInvoke. Possibly mention jsonCall.

From:

http://groups.google.com/group/liftweb/browse_thread/thread/37bb6d165ba6bee9/d7bd4aca18ccec50?lnk=gst&q=%5BLift%5D+Easiest+way+to+trigger+server-side+Scala+code+#d7bd4aca18ccec50

and

http://blog.fmpwizard.com/scala-lift-custom-wizard (search for Call Scala code from JavaScript.)

Downloadable epub

Would be a great convenience to readers if the text were packaged as a downloadable ePUB file on GitHub.

create a project and setup Intellij IDE

Hi Richard,
Love your idea of the cookbook.

I wrote some time ago a blog post on how to create a new project with maven and setup Intellij to run and debug the project.. It has a few screenshots that always help!

The post is here
You are free to copy the content to your cookbook or link the post, whatever suits!

If I'll have something else will definitely get in touch!

Cheers

Debugging SQueryl SQL

You want to see the SQL being executed by SQueryl

answer:

org.squeryl.Session.currentSession.setLogger( s => println(s) )

perhaps use logger instead?

discuss:
what other options are there?

see also:
squeryl links

Using Lift Snapshots

You want to run against the latest-and-greatest Lift snapshot.

Solution:

sbt changes from the example build.sbt given as the first cookbook recipe

Better Pamflet display on large screens

"I have one complaint though. I have a Big monitor - Apple 30" 2560x1600. I have my browser taking up almost the entire screen and so there's this gigantic empty spot on one side, a gigantic empty spot on the other side and a teeny little strip of text in the middle. Is there a way to change the formatting so that it makes better use of
the available space?"

http://groups.google.com/group/liftweb/browse_thread/thread/cb8e88110df390cd/a105e5aa59a7b25a?lnk=gst&q=2560x1600#a105e5aa59a7b25a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.