You need to sign in to do that
Don't have an account?
SOUBHAGYA RANJAN DALAI
adding attachment to every record retrived
Hi ALL
i want to show 10 attachment under each contact record and when we check the particular contact record and click the button(process selected) then it will be downloaded in local system . i am giving my code of contact record . please help me ou to do this
VF PAGE
<apex:page controller="wrapperClassController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Process Selected" action="{!processSelected}" rerender="table"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!contacts}" var="c" id="table">
<apex:column >
<apex:inputCheckbox value="{!c.selected}"/>
</apex:column>
<apex:column value="{!c.con.Name}" />
<apex:column value="{!c.con.Email}" />
<apex:column value="{!c.con.Phone}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
CONTROLLER
public class wrapperClassController {
public List<cContact> contactList {get; set;}
public List<cContact> getContacts() {
if(contactList == null) {
contactList = new List<cContact>();
for(Contact c: [select Id, Name, Email, Phone from Contact limit 10]) {
contactList.add(new cContact(c));
}
}
return contactList;
}
public PageReference processSelected() {
List<Contact> selectedContacts = new List<Contact>();
for(cContact cCon: getContacts()) {
if(cCon.selected == true) {
selectedContacts.add(cCon.con);
}
}
System.debug('These are the selected Contacts...');
for(Contact con: selectedContacts) {
system.debug(con);
}
contactList=null;
return null;
}
public class cContact {
public Contact con {get; set;}
public Boolean selected {get; set;}
public cContact(Contact c) {
con = c;
selected = false;
}
}
}
i want to show 10 attachment under each contact record and when we check the particular contact record and click the button(process selected) then it will be downloaded in local system . i am giving my code of contact record . please help me ou to do this
VF PAGE
<apex:page controller="wrapperClassController">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Process Selected" action="{!processSelected}" rerender="table"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!contacts}" var="c" id="table">
<apex:column >
<apex:inputCheckbox value="{!c.selected}"/>
</apex:column>
<apex:column value="{!c.con.Name}" />
<apex:column value="{!c.con.Email}" />
<apex:column value="{!c.con.Phone}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
CONTROLLER
public class wrapperClassController {
public List<cContact> contactList {get; set;}
public List<cContact> getContacts() {
if(contactList == null) {
contactList = new List<cContact>();
for(Contact c: [select Id, Name, Email, Phone from Contact limit 10]) {
contactList.add(new cContact(c));
}
}
return contactList;
}
public PageReference processSelected() {
List<Contact> selectedContacts = new List<Contact>();
for(cContact cCon: getContacts()) {
if(cCon.selected == true) {
selectedContacts.add(cCon.con);
}
}
System.debug('These are the selected Contacts...');
for(Contact con: selectedContacts) {
system.debug(con);
}
contactList=null;
return null;
}
public class cContact {
public Contact con {get; set;}
public Boolean selected {get; set;}
public cContact(Contact c) {
con = c;
selected = false;
}
}
}
i want some attachment under each record .
i want the code for that .