0

I have 3 same sections in visualforce page. Users will have 3 of this section minimal to fill out. But what i want to make is button on which i will add new section, same as others. Because user may need 20 of this section, maybe 30. But some of them maybe need only 3. I don't want to take a lot of space, so i want to make some button '+' on which i will be available to add as much sections as i want. Can someone help me? ( image)

enter image description here

1
  • Include your current code please.
    – Dave Humm
    Jan 22, 2017 at 18:23

1 Answer 1

1

You can output an apex:pageBlockSection per object, starting with 3 created in your controller and then having a button that adds one at a time and re-renders the page block to show the new additions:

<apex:page controller="...">
    <apex:form >
        <apex:pageBlock >
            <apex:repeat value="{!contacts}" var="c">
                <apex:pageBlockSection title="Authorized Person">
                    <apex:outputField value="{!c.Name}"/>
                    ...
                </apex:pageBlockSection>
            </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>
2

Not the answer you're looking for? Browse other questions tagged .