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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:55:24+00:00 2026-06-09T03:55:24+00:00

I have a select box of TYPES that each type has their own PARAMETERS.

  • 0

I have a select box of TYPES that each type has their own PARAMETERS. The TYPES select box will fire off some AJAX that calls a template and renders PARAMETER select boxes on my view. The Parameters are made up of name:value pairs, thus every name can have many values.

Some parameters need multiple=’true’ for the user to select multiple values for each name, while other parameters need to be restricted to only one choice.

In my gsp page I have a bunch of these:

    <g:if test="${it?.getKey().toString().equals('PARAMETER_A')}">
      <td><g:select multiple="true" optionKey="id" optionValue="value" name="sampleParameters" id="parameter" value="${params?.sampleParameters}" from='${it?.getValue().sort()}'></g:select></td>
    </g:if>
    <g:if test="${it?.getKey().toString().equals('PARAMETER_B')}">
      <td><g:select multiple="true" optionKey="id" optionValue="value" name="sampleParameters" id="parameter" value="${params?.sampleParameters}" from='${it?.getValue().sort()}'></g:select></td>
    </g:if>

My issue is that I have 6 parameters for one particular TYPE that need to select multiple values, the rest do not. Rather than explicitly type out as above, is there a way that I can test for more than one thing in a g:if statement like you can in java? such as:

if(something.equals(PARAMETER_A) || something.equals(PARAMETER_B))

etc.

Is there a way to do something similar to java’s approach in groovy?

  • 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-06-09T03:55:25+00:00Added an answer on June 9, 2026 at 3:55 am

    Grails g:if just uses groovy in its test attribute. So to answer your question, yes:

    <g:if test="${something.equals(PARAMETER_A) || something.equals(PARAMETER_B)}">
    </g:if>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a select box that is being populated dynamically from a database. As
I have a select box on a page that does a post with jQuery
I have a select box which has more than 200 items. Below the select
I have a select box that needs to submit it's value to a server
I am using chosen.js ( http://harvesthq.github.com/chosen/ ) and I have a select box that
I have some code that locates all the contact folders that a user has
i have a select box where in it has a list of items and
I have an input box that as you type displays a div called suggestions
I have a system that allows a person to select a form type that
I have defined an object that has several attribute.. class thing(object): def __init__(self, type,

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.