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 6586147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:45:12+00:00 2026-05-25T16:45:12+00:00

I am trying to incorporate Knockout.js into a WebApplication. The tutorial I am basing

  • 0

I am trying to incorporate Knockout.js into a WebApplication.

The tutorial I am basing much of my code on is here.

Basically – I have a list of items – I want to be able to click an item and have the corresponding data appear in a div at the bottom of the page. Eventually I’ll use jquery.UI Dialog plugin to turn this div into a popup, but for now, I’m just trying to get the selectedItem to work.

My (simplified) code is here: http://jsfiddle.net/fZXAX/1/

I just get the error: actionListViewModel.selectedActionId is not a function.

I don’t see the difference between this and the tutorial which uses selectedMailId in an identical way. The only difference between my code and the example is that I am not using literal notation.

Can anyone see where I am going wrong?
Thanks in advance.

  • 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-25T16:45:13+00:00Added an answer on May 25, 2026 at 4:45 pm

    Your error is here:

    click: function() {actionListViewModel.selectedActionId(id)}
    

    actionListViewModel is a constructor function, but you’re acting as if it’s an object.

    See this forked jsFiddle. This line, which defines a constructor function

    function actionListViewModel () {
    

    was changed to be an instance of a new object, created by calling an anonymous constructor function.

    var actionListViewModel = new function () {
    

    and this line, where you were creating an instance of your previously defined function

    ko.applyBindings(new actionListViewModel());
    

    was changed to just pass in the instance that we setup earlier

    ko.applyBindings(actionListViewModel);
    

    Alternatively you could simply define a variable viewModel and set it = new actionListViewModel(); and then update your click literal to point to viewModel instead of actionListViewModel. You can see that approach here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to incorporate the Singleton design pattern into my code, but I
I'm trying to incorporate my rss feed into my website but I want to
I am trying to incorporate some sample code I pulled from a site into
I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently
I am just learning ASP.NET c# and trying to incorporate best practices into my
So I am trying to incorporate a hashtag search into posts on my application.
So I recently have been trying to incorporate more sub forms to make the
Hi I'm developing an Android app and trying to incorporate maps into one of
I am trying to incorporate a regular expression i have used in the past
Hey everyone. I am trying to incorporate a simple UINavigationController into my tab bar

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.