function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prasanth kumarprasanth kumar 

how to display values in specific command button in pageblocktable

i added command button for every coloum in apex:repeat, if i click on that button then it is invoking wrapper class and displaying the wrapper class rows to all columns in apex:repeat ....  i want to only display the wrapper class data for the specific row only.  please help me.

User-added image
Visualforce page:-
<apex:page controller="createDynamicTableProcess" >
<apex:form >
<apex:pageblock title="All contacts" >
<apex:repeat value="{!cons}" var="a" >
<table border="1" width="300px;" > <tr> 
<td><apex:outputtext value="{!}" /> <br/></td>
<td><apex:outputtext value="{!}" /><br/></td>
<td><apex:outputtext value="{!a.account.industry}" /><br/></td>
<td><apex:commandbutton value="Add Row" action="{!createRecordForSubContact}" >
<apex:param name="sending contact id" value="{!}" assignto="{!contactid}" />

</tr> </table> 
  <apex:pageblocktable value="{!scw}" var="a" id="pbt1">
            <apex:column ><apex:inputcheckbox value="{!a.flag}" /> </apex:column>
            <apex:column ><apex:inputtext value="{!}" onchange="getrec(" id="v1"/> </apex:column>
            <apex:column ><apex:inputtext value="{!}" onchange="getrec(" id="v2"/> </apex:column>



public class createDynamicTableProcess {

public list<contact> cons{set;get;}
public string contactid {set;get;}
public list<subcontactwrapper> scw{set;get;}
public createDynamicTableProcess ()
    cons=new list<contact>();

    list<string> accids=new list<string>();
        for(account a1:[select id from account])

       cons=[select id,name,phone,account.industry from contact where accountid in:accids limit 10];
} //constructor closed

//method for button click for every contact.
public void createRecordForSubContact()
scw=new list<subcontactwrapper>();
subcontactwrapper s1=new subcontactwrapper();


public class subcontactwrapper
public boolean flag {set;get;}
public string name {set;get;}
public string country {Set;get;}
public date  startdate {Set;get;}