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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:26:12+00:00 2026-05-31T21:26:12+00:00

I really like Play 2.0’s form mapping system, but I had a question about

  • 0

I really like Play 2.0’s form mapping system, but I had a question about how to implement forms with lists of similar controls.

In Rails, if I had a list of form parameters like

foo[]=3, bar[]=4, foo[]=2, bar[]=5

I’d get a structure that looks like

[{:foo => 3, :bar => 4}, {:foo => 2, :bar => 5}]. 

In Play, I can do this by specifying explicit indices, e.g.

foo[0]=3, foo[1]=4, etc.

But for forms where I can dynamically add and remove list entries on the page before submitting the form to the server, this requires a little bookkeeping to make sure the indices are right. Does Play support something like Rails’s approach, where I can add new foo/bar pairs to my forms and have each occurrence appear as a separate entry in an array?

  • 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-31T21:26:13+00:00Added an answer on May 31, 2026 at 9:26 pm

    The problem you have comes from the RepeatedMapping where the indexes function in the companion is simply collecting the ints, sorting them and finally distinct…

    What could be done is to update the map to have indexes continuous…

    So the only way, I can see so far at least, is to create the same kind of RepeatedMapping that will handle it… But I guess it could be added as a improvement of the functionality?

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

Sidebar

Related Questions

I really like Play and it adresses all the problems I had when develpoing
I really like the promote to home page feature of drupal. But what if
I really like the idea of automatic binding generation like SWIG does. But it
I started to play with log4net today and so far, I really like it.
Hi I play with GWT in the weekends, and I really like what i've
I'm experimenting with the Play Framework and really like the experience thus far! Especially
It looks like I had a fundamental misunderstanding about C++ :< I like the
I'm trying to play a video (MP4/H.263) on iOS, but getting really fuzzy results.
Two things I really like about Guava 11's CacheLoader (thanks, Google!) are loadAll(), which
I really like the MVC way and have actually enjoyed learning ASP.NET MVC (I

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.