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?

  • 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


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


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

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


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

You must log in to answer this question.

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