Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7646839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:18:43+00:00 2026-05-31T10:18:43+00:00

I am trying to use Liftscreen to implement a form in ajax but I

  • 0

I am trying to use Liftscreen to implement a form in ajax but I want to use Ajax, that is to say that I want the finish function to be called whenever a field is updated. Usually I use functions like SHtml.ajaxText to achieve this goal but I would prefer to use LiftScreen as it already has a lot of routines included.

Here is a basic example of code I am using

class ScreenTest extends LiftScreen {

  // here are the fields and default values
  val name = field("Name", "")

  // the age has validation rules
  val age = field("Age", 0, minVal(13, "Too Young"))

  def finish() {
    println("-------> Finish function has be called")
    S.notice("Name: "+name)
    S.notice("Age: "+age)
  }
}

So I would like the finish function to be called whenever the field name or age is called. I would prefer a general setting instead of manually calling finish in each field.

Update I am working on a search engine depending on some criteria, so I want my results to be updated whenever a criteria is modified.

I already read the documentation page about LiftScreen on Assembla and I also found a discussion about ajax on LiftScreen on the official mailing list (which I will contact if I can’t find any answer in here)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:18:45+00:00Added an answer on May 31, 2026 at 10:18 am

    I would try adding a small javascript to the template you are using for your screen (wizard-all ?). For instance:

    jQuery('input').change(function() {
        jQuery('#idOfForm').submit();
    });
    

    Not sure if it is possible to add such a script from the LiftScreen snippet.

    EDIT
    Another way would be to use a custom field as described in the wiki here. I think you could do something along the lines of:

    object AjaxifiedScreen extends LiftScreen { 
      val name = new Field { 
        type ValueType = String 
        override def name = "name" 
        override implicit def manifest = buildIt[String] 
        override def default = "" 
        override def toForm: Box[NodeSeq] = SHtml.ajaxText(is, doStuff(_)) 
      } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use double type in openCL, but doesn't work anyway, i want use
Trying to use Java's regexp I want to match /app, /app/.* , but not
Hi I'm trying use a datepicker on a field I have. I'm trying to
I have been trying use the edit_post_link() function to contain an image. All of
trying to use the preferred on method call but the code is not working
I am trying use filehelpers class builder but I am kinda confused on what
I am trying use a javascript function while passing php variables in it. For
I am trying use a javascript function while passing php variables in it. For
I am trying use Date Picker and on Select i want to display the
I was trying use svn to find a checkin using svn log, but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.