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

  • Home
  • SEARCH
  • 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 6044523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:01:17+00:00 2026-05-23T07:01:17+00:00

Ok, so i have a custom object that is a myUser. myUser looks like

  • 0

Ok, so i have a custom object that is a myUser.

myUser looks like this :

username:String = ""
firstname:String = ""
lastname:String = ""

I have a list of these users that come into a page, I’ve made a link to view the details of each user. When you click on a user, it will fill the boxed object that I have as a request var, and then direct to the detail page to view this user information. Why is that I can’t bind from a map on this object? Here is some code…

private object selectedUser extends RequestVar[Box[myUser]](Empty)

def getusers(html: NodeSeq):NodeSeq = {

    //This gets me a list of 10 users that are "myUser" objects
    val userList = User.getUsers(10)

    userList.flatMap{user => bind("user", html,
        "username" -> SHtml.link("/%2Fadmin%2Fdetail", () => selectedUser(Full(user)), Text(user.username)),
        "firstname" -> {user.firstname},
        "lastname" -> {user.lastname},
        "lastloggedin" -> {user.lastloggedin})}
}

Now when I arrive at the user detail page, I want to map out the selectedUser object i’ve written….but for some reason, I can’t get it to work, it’s giving me this error :

type mismatch; found :
net.liftweb.common.Box[scala.xml.NodeSeq]
required: scala.xml.NodeSeq

Here is the code that’s giving me this error :

def userdetail(html: NodeSeq):NodeSeq = {
    selectedUser.is.map{user => bind("user", html, 
        "username" -> {user.username},
        "firstname" -> {user.firstname},
        "lastname" -> {user.lastname},
        "lastloggedin" -> {user.lastloggedin})}
}

The interesting thing is, i can do it this way, and it will work, but there has got to be a way to do it on one line right?

This works…but it’s cumbersome :

def userdetail(html: NodeSeq):NodeSeq = {

    var username = ""
    var firstname = ""
    var lastname = ""
    var lastloggedin = ""

    bind("user", html, 
        "username" -> {username},
        "firstname" -> {firstname},
        "lastname" -> {lastname},
        "lastloggedin" -> {lastloggedin})
}

Can someone please tell me the little thing i’m missing here? I hope I explained myself clearly enough.

Thanks!

  • 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-23T07:01:18+00:00Added an answer on May 23, 2026 at 7:01 am

    This will give you an empty NodeSeq iff there is no selectedUser and the result of the bind otherwise.

    def userdetail(html: NodeSeq):NodeSeq = {
        selectedUser.is.toList.flatMap{user => bind("user", html, 
            "username" -> {user.username},
            "firstname" -> {user.firstname},
            "lastname" -> {user.lastname},
            "lastloggedin" -> {user.lastloggedin})}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom object that implements INotifyPropertyChanged. I have a collection of these
I have a custom Javascript object that has a few string and float members.
This project is in c# under .net 4. I have a custom object that
I have a custom object that I was adding to an array via a
I have a custom principal object that I want to be able to serialize
I have a DateTime object that I need to print in a custom gridlike
I have a UITableView that displays various nsstrings from a custom object called a
i have an ASP.NET web service that returning a custom entity object (Staff): [WebMethod]
I have a data object -- a custom class called Notification -- that exposes
So I have this custom object i made called 'Box', it's throwing the error

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.