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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:12:01+00:00 2026-05-28T00:12:01+00:00

I have the following model class (simplified) class A{ private String name; private List<B>

  • 0

I have the following model class (simplified)

class A{
  private String name;
  private List<B> items;
}

class B{
  private long from;
  private long to;
}

Moreover I have Form that gets the class A bound by a CompoundPropertyModel. If I want to display a TextField that is bound to the name field, I just add

new TextField("name"); 

and that’s all. But how do I correctly bind this list of items? For class B I also have FormComponent that overrides the convertInput, because I want to do some calculations before assigning the values to the fields from, to.
I have tried (Property)ListView, but both seem not to work (or I use them in a wrong way).

Thank you and kind regards,

M.

  • 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-28T00:12:02+00:00Added an answer on May 28, 2026 at 12:12 am

    Using

    Form form = new Form("form", new CompoundPropertyModel(modelObject));
    form.add(new ListView("items")); 
    

    is equivalent to

    Form form = new Form("form", new CompoundPropertyModel(modelObject));
    form.add(new ListView("items", new PropertyModel(modelObject, "items"));
    

    The ListView’s Model will be backed by the items property of the CPM’s model object.
    Remember to override populateItem, in which the ListItem‘s model object will be each one of the elements in the List.

    You can perform your calculations on the items property of the backing model object. If you don’t want to modify the model object’s property, you shouldn’t be using CPM to bind the items property, and implement a Model that provides the modified List (might be useful if you want these calculations to be updated at every page rendering, as in ajax refreshing.

    This Wicket wiki page shows the usage of ListView: ListView and other repeaters

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

Sidebar

Related Questions

I have the following (heavily simplified) model, that uses will_paginate class Search < ActiveRecord::Base
I have the following models (simplified): class Location(models.Model): name = models.CharField(max_length=100) is_ok = models.BooleanField()
I have the following model: class User: name = models.CharField( max_length = 200 )
Ok say I have the following model: class Country < ActiveRecord::Base validates_presence_of :name validates_presence_of
I have the following model structure: class Container(models.Model): pass class Generic(models.Model): name = models.CharacterField(unique=True)
So I have the following model: public class Person { public String FirstName {
I have the following model and instance: class Bashable(models.Model): name = models.CharField(max_length=100) >>> foo
I have the following in my model: class info(models.Model): add = models.CharField(max_length=255) name =
I have the following Model class: package com.swaranga.model; public final class Book { private
I have the following model (simplified): abstract class CartItem { EntityReference<Cart> Cart; } class

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.