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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:56:44+00:00 2026-05-27T06:56:44+00:00

How do I dynamically render HTML in Play? For example I have an enum

  • 0
  1. How do I dynamically render HTML in Play? For example I have an enum or DB table with a list of platforms (pc/xbox/ps3). I want to render in my HTML form a checkbox list with each of those. For now I’ve just hard coded the HTML form with elements, but long term it needs to be dynamic and the lists (checkbox/radio/dropdown) need to be bound to the system so they receive new items as new items are added to the database.

  2. On postback how do i access those form fields in the controller handling the postback? I’ve found that in the controller action’s function parameter list I can specify the name of the form field, and that works, but this is unrealistic if i’m going to have forms that have 100 fields, then I do’nt want to have to declare 100 params in my controller action function.

  • 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-27T06:56:45+00:00Added an answer on May 27, 2026 at 6:56 am
    1. you can call method values() on enums to obtain array of enum values. And then map it to List. For example you can use Lists.newArrayList(array) from google-collections.

    2. form parameters you can find in request.params hashmap. Request is a field inherited from play.mvc.Controller.

    Also have a look at this http://www.playframework.org/documentation/1.2.3/cheatsheet/controllers. (Usefull stuff but not easy to find)

    UPD

    List theList =....;
    render(theList);

    and in the template (example for select):

    <select id="viewSelect" size="1" >
      #{list items:theList, as:'listItem'}
       <option id="${listItem.getId()}">${listItem.getName()}</option>
      #{/list}
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my view, I have a form I want to dynamically render. This form
I have custom Question objects which I render into html form elements. I want
In MVC Application, I want to render some parts of form dynamically (which are
I've created a Javascript object via prototyping. I'm trying to render a table dynamically.
I have the following code. def add_resume_link(name, form) link_to_function name do |page| html =
I have a form to which I want to add extra fields depending on
So far we can use Html.EditorFor() to dynamically render the appropriate template for a
I have a table of paged data, along with a dynamically created pager (server-side
I have a page which generates HTML dynamically and does an echo of it.
I'm building a html table dynamically in an ASP.NET code behind file using C#.

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.