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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:52:32+00:00 2026-05-30T21:52:32+00:00

i have 2 drop downs in my UI,selecting one would give another set of

  • 0

i have 2 drop downs in my UI,selecting one would give another set of check boxes configured for that particular value selected from the drop down.each time i add some connection between the selected value and the value in checkboxes, it should save somewhere and correctly identify the element so that i can delete it, still retaining the values which were there before

—-UI—-

Select box
        <button style="display: none;" type="submit" id="selected" name="_eventId_getid"></button> 
        <label for="name" >Product</label> 
        <form:select path="selectedProduct" disabled="${isDisabled}" onchange="simulateClick('selected');">
            <form:option value="0">Select...</form:option>
            <form:options items="${createProject.product}" itemLabel="name" itemValue="id" />
        </form:select>
    checkbox, depending upon slectbox   
  <button style="display:none;" type="submit" id="selectCopyType" name="_eventId_submit"> </button>
        <c:if test="${not empty createProject.elementType}">    

                <button style="display: none;" type="submit" id="copy" name="_eventId_getId2"></button> 
                    <input class="checkAllCheckbox" id="selectall"  name="selectall" type="checkbox"/>
                    <span style="display:inline; margin-left:auto;">Select All</span>
                    <!-- id must be the same as listId above -->
                    <div class="CFbox" id="id"  >
                    <form:checkboxes items="${ProjectCommand.ElementType}" onclick="simulateClick('copy')" path="CopyType" cssClass="case" itemValue="id" itemLabel="name"  name="case"/>                   </div>
              </div> 

      Class Command
      private String seelctedProduct;
      private List<Integer> CopyType;
      private List<Class1> class1


  Class Class1


      private Integer seq = 0;
      private String product;
     private String ElementName

      public void getSelectedCopy(Command command)
      {
        Map<Integer,String[]>map= new HashMap<Integer,String[]>();
        if (command.CopyType() != null && command.getCopyType().size() > 0)
        {
          List<Class1> copyList = new ArrayList<Class1>();

          Integer Seq = 0;
         if (command.getClass1() != null && command.getClass1().size() <= command.getCopyType.size())
          {
            //Max CfSeq is stored in the variable -1 . 
           Seq = command.getClass1().get(command.getClass1.size() - 1).getSeq();    
          }

         for ( int copytype : command.getCopyType())
          {

           if (command.getCopyType().size() >1)
            { 
             if (copyType <= Seq)
              {
               copyList.add(command.getClass1().get(Seq - 1));
                continue;
              }
            }
            cfSeq++;

            map.put(Seq,new String[]{command.getseelctedProduct(),"copyType"});
            System.out.println("map"+map);
            Class1 objclass1= new Class1();
            objclass1.setProduct(command.getseelctedProduct());
            objclass1.setElementName(copyType + "");
            objclass1.setSeq(Seq);
            copyList.add(objclass1);

          }
          command.setClass1(copyList);
        }
        else
        {
          command.setClass1(null);
        }
      }

Right now i am not getting the correct seq number and i am not able to delete the correct member from the map.. hope you guys got what i am trying to do!! thanks for the help.I guess i need need logic to add and delete from hashmap comparing values rather than matching keys, if you got other suggestions for correctly displaying the sequence rather than clearing up the object each time.. please suggest

  • 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-30T21:52:33+00:00Added an answer on May 30, 2026 at 9:52 pm

    If your problem really is to have a value -> key lookup, you should have a look at guava or Commons collections.

    Guava:
    http://www.discursive.com/books/cjcook/reference/collections-sect-key-by-value

    Commons collections bidimap:
    http://commons.apache.org/collections/api-3.1/org/apache/commons/collections/BidiMap.html

    Commons collections is kind of old and stable, while guava is offering a lot of new paradigms and type safety using generics.

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

Sidebar

Related Questions

I have n drop-downs like this: <select id=select1> <option>1</option> <option>2</option> <option>3</option> </select> <select id=select2>
I have a drop down list that has options that need to be passed
I have a drop down in html. When I change the value of the
I have two sets of drop downs for start date and end date. Each
I have a page that shows 3 drop-down selectors on the page. I also
I have a winforms ContextMenuStrip that has ToolTipText set for all of it's ToolStripMenuItem's.
I have a multitude of dropdown boxes within my web page. One of these
I have two separate fields with a drop-down list, one is for User and
I have created an editor template for representing selecting from a dynamic dropdown list
I have a drop down like this on my page: <p> <%= f.label :episode_id

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.