0

I'm kinda stuck on figuring this out. I'm looking to add dynamic rows containing two drop downs anyone know how i go about doing this?

2
  • Are you asking how to add dynamic rows into a pageblocktable, or how to add custom dropdowns into a row, or both?
    – Jan Julian
    Commented Oct 8, 2014 at 20:59
  • dynamic rows into a pageblocktable
    – rlewi17
    Commented Oct 8, 2014 at 21:22

1 Answer 1

1

Here's one way of adding a new row to your <apex:pageBlockTable> dynamically

Controller

public class YourController {
    public List< ... > rows { get; set; }

    public void addRow() {
        rows.add( ... );
    }
}

Visualforce

....
<apex:commandButton value="Add Row" action="{!addRow}" rerender="dynamicTableContainer"/>
...
<apex:outputPanel id="dynamicTableContainer">
    <apex:pageBlockTable value="{!rows}" var="row">
        ...
    </apex:pageBlockTable>
</apex:outputPanel>

You must log in to answer this question.

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