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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:11:17+00:00 2026-05-31T06:11:17+00:00

Hi I am getting a headache with the visualforce repeater control: <apex:repeat value={!productDetails} var=o>

  • 0

Hi I am getting a headache with the visualforce repeater control:

 <apex:repeat value="{!productDetails}" var="o">
     <apex:pageBlockSectionItem >
         <apex:outputText style="label" value="Name:"></apex:outputText>
         <apex:outputLabel value="{!o.name}" /> 
     </apex:pageBlockSectionItem>

     <apex:pageBlockSectionItem >
         <apex:outputText value="{!o.ProductCode}"/>   
         <apex:outputText value="{!o.Family}" />  
     </apex:pageblockSection> 

     <apex:pageBlockSection> 
         <apex:outputText style="label" value="Quantity:"> </apex:outputText>
         <apex:inputText value="{!theList}"/>
     </apex:pageblockSection> 
 </apex:repeat>

What I am trying to do, is for each record in the product details list, generate a text box. This text box is bound to another field (theList.quantity). But I am finding that when I change the value in the last text box it sets the quantity in all the text boxes(obviously as they are bound to the same field).

So my question is whats the best way to have each textbox that is generated in the repeater have its own parameter value?

Or am I using the repeater in the wrong way?

EDIT(clarification):

For each product detail record(What I am iterating through) I want to have a textbox where a user can enter the quantity of products. The value of this textbox is unrelated to the product detail records.

My question is how can I generate unique parameters for each iteration of the textbox? Hopefully that makes sense.

Cheers

  • 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-31T06:11:19+00:00Added an answer on May 31, 2026 at 6:11 am

    The easiest way to do this is to add a custom field to the object you’re repeating through. However, I understand there are cases where that’s not desirable.

    You probably could use a custom Apex object (not custom Salesforce object) for this. You can do this by adding a nested class within your Controller or Extension.

    For example:

    public class MyClass 
    {
        public class MyProductDetail
        {
            public string Name {get;set;}
            public string Family {get;set;}
            public string ProductCode {get;set;}
            public integer Quantity {get;set;} // theList
        }
    
        public List<MyProductDetail> MyProductDetails {get;set;}
    }
    

    You would need to loop through all of your Product detail records (returned from SOQL), and add them to the MyProductDetails list. Once you have that, though, you can use a Visualforce Repeater to display each of them them and save the inputted quantity data for each record.

    <apex:repeat value="{!MyProductDetails}" var="o">
        <apex:pageBlockSectionItem >
            <apex:outputText style="label" value="Name:"></apex:outputText>
            <apex:outputLabel value="{!o.Name}" /> 
        </apex:pageBlockSectionItem>
    
        <apex:pageBlockSectionItem >
            <apex:outputText value="{!o.ProductCode}"/>   
            <apex:outputText value="{!o.Family}" />  
        </apex:pageblockSection> 
    
        <apex:pageBlockSection> 
            <apex:outputText style="label" value="Quantity:"> </apex:outputText>
            <apex:inputText value="{!o.Quantity}"/>
        </apex:pageblockSection> 
    </apex:repeat>
    

    Hope that helps!

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

Sidebar

Related Questions

I'm getting into django and this is getting me a headache. I'm trying to
I'm getting a bit of a headache trying to figure out how to organise
I'm a mod_rewrite noob and I'm getting a headache trying to figure out something
I am getting a headache with PHPUnit's behavior of always running TRUNCATE prior to
I'm getting headache to join my table. Currently I used this way <?php $result
I am getting a headache with standard socket class of .NET framework. Could anybody
I'm getting an insane headache because of this... I'm trying to log into this
I'm getting a bit of a headache trying to figure this one out. To
I'm getting a headache from this query, I have no idea how to solve
I am getting a headache! I've been working on this code for hours now,

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.