Author: Ayush Mishra

How to use Liftweb’s built-in functionality for Sorting and Pagination using Scala

Reading Time: 2 minutes In this blog , we will have a basic idea that how to use LiftWeb’s built -in functionality for Sorting and Pagination . Lift provides SortedPaginatorSnippet for sorting of results and PaginatorSnippet for paging of results . Suppose you are displaying an item list on web and you want to sort and paginate that list then you have to implement both snippets SortedPaginatorSnippet and PaginatorSnippet Continue Reading

Integrate PayPal in LiftWeb application using Scala

Reading Time: 3 minutes If you are developing an E-Business web application , where you have to provide online payment solution to your customer then PayPal is one of the most secure , faster and easier way to make payment online . In this blog, we will have a basic idea that how easily you can integrate PayPal functionality in your Liftweb project using Scala . We are assuming Continue Reading

A Simple Login Application in Liftweb using Scala and MongoDB

Reading Time: 1 minute Liftweb is an elegant , designer friendly and arguably the most powerful web framework that provides developers ability to create secure , scalable , maintainable , rich and interactive web applications . It is built on the top of Scala and takes View-First approach rather going via the standard Model-View-Controller way. Now , Let’s look at a simple example . This is a simple login Continue Reading

Scala Liftweb : Re render page element without making any request to the server

Reading Time: 2 minutes Lift introduces a powerful feature that enables developer to create rich interactive application using Comet and Ajax support . Using Comet , its easy to push content from server to browser by sending request asynchronously . AJAX works for a single client at a time , while Comet works for multiple users . Comet works like AJAX but in opposite direction . In this blog Continue Reading

An alternate way to implement JOINs in MongoDB [Update]

Reading Time: 2 minutes I have updated this blog . As last description was creating some misunderstanding and lot of confusion . In one of my project , there was a requirement to generate report in .csv format from MongoDB without using any reporting tool and any language . I had to use only MongoDB query . In that report , I had to use multiple collection . Since Continue Reading

Scala LiftWeb: Upload File using AJAX

Reading Time: 1 minute Liftweb provides AJAX functionality for all html elements except file upload using Scala . But there is a way to upload file using AJAX by binding form as AJAX form . 1) add below lines in your html . <div class="lift:FileSnippet.uploadFile"> Upload File : <input name="upload" type="file"></input> <input type="submit" name="submit" value="Upload"/> </div> 2) class FileSnippet { def uploadFile(form: NodeSeq): NodeSeq = { def handleFile():JsCmd = Continue Reading

Play With Liftweb’s AJAX Generators using Scala

Reading Time: 2 minutes AJAX is an approach for building dynamic web content on the client side . In Liftweb , we can implement this approach either by AJAX or by Comet . Comet is like AJAX , except in opposite direction . AJAX model increases the richness of the User Experience for a single client at a time, Comet can do the same for multiple users. First thing Continue Reading

Scala Liftweb : Use Forgot Password Inbuilt Functionality to send Email with Unique Token

Reading Time: 1 minute If you are implementing Forgot password functionality in your web application using Liftweb and you have such a scenario where you have to send redirect URL with unique token in Email , Liftweb with Scala provides a wonderful functionality to handle this . 1) Write a function to send URL with unique token in Email . def sendLoginToken(user: User): Unit = { import net.liftweb.util.Mailer._ val Continue Reading

Play with Lift’s Autocomplete Widget using Scala-One of the Best Feature of LiftWeb Framework

Reading Time: 3 minutes The AutoComplete widget provides a flexible and accessible way to offer suggestions or some kind of filtering information as a user type text information in an input field . If you have used Google , you might see that Google starts providing autocomplete suggestion with entries depending on user’s current input . Lift provides a very easy way to implement Autocomplete using Scala . Here Continue Reading

Re Render HTML Template using Scala and Lift

Reading Time: 1 minute In this section , I will explain how to re-render HTML Template without loading the browser . You can refresh HTML template without loading browser via AJAX using Scala and Ltft . Lift provides SHtml.memoize which memoize the NodeSeq used in apply() and then call applyAgain() in an Ajax call . You can re render a particular template part of HTML page or complete page Continue Reading

Implement Geolocation using Scala and Lift

Reading Time: 1 minute In this section , I will explain how to implement Geolocation using Scala and Lift . You can easily fetch user’s current location or near by location by his IP address . 1) You will need API key to be able to use . To get API key , just Go to IPInfoDB . 2) Get user’s IP address var ipAddress: String = "" S.containerRequest.map(r Continue Reading

Play with Cookies using Scala and Lift

Reading Time: 1 minute As we know , Cookie is a small piece of data which is sent from a website and stored in a user’s web browser while a user is browsing a website. Next time , when user browses , cookie can be retrieved . Cookies are essentially a token of string data that is stored on the user’s machine. In this section , I will explain Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!