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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:46:53+00:00 2026-05-10T16:46:53+00:00

Given an Item that has been appended to a Form , whats the best

  • 0

Given an Item that has been appended to a Form, whats the best way to find out what index that item is at on the Form?

Form.append(Item) will give me the index its initially added at, but if I later insert items before that the index will be out of sync.

  • 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. 2026-05-10T16:46:53+00:00Added an answer on May 10, 2026 at 4:46 pm

    This was the best I could come up with:

    private int getItemIndex(Item item, Form form) {     for(int i = 0, size = form.size(); i < size; i++) {         if(form.get(i).equals(item)) {             return i;         }     }     return -1; } 

    I haven’t actually tested this but it should work, I just don’t like having to enumerate every item but then there should never be that many so I guess its ok.

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

Sidebar

Related Questions

I've been given a SQL table that has a parent-child relationship that I'd like
This has been asked before but without an answer that works for me (and
Note: When creating a new tiff image that has never been altered by the
I have a Database that has the following relations: Transaction->Purchase->Item->Schedule Transaction - self explanitory
I have been making a hotel booking software that calculates, for given dates and
I want to get the second last item given to a shell program. Currently
Given a single item, how do I count occurrences of it in a list,
Given the class: public class Item { [Key] public int ID { get; set;
Given this example data set: ----------------------------- | item | date | val | -----------------------------
Given the following code: $(.force-selection).blur(function() { var value = $('matched-item').val(); //check if the input's

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.