You need to sign in to do that
Don't have an account?
Praveen Kumar 212
Send checked records to a popup window
Hey,
I want to send checked records to a popup page. I am unable to figure out how to send list of records page to page.
Here's my code.
I want to send checked records to a popup page. I am unable to figure out how to send list of records page to page.
Here's my code.
<apex:page controller="wrapperClassController" > <apex:form id="form" > <apex:pageblock > <apex:outputLabel value="Select Filter"/> <apex:selectList value="{!selprio}" size="1" > <apex:actionSupport status="st" event="onchange" action="{!actsel}" reRender="form"/> <apex:selectOptions value="{!prior}"/> </apex:selectList> <apex:actionStatus id="st" startText="In Progress......" stopText="Done" /> </apex:pageblock> <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Delete" action="{!Del}" /> </apex:pageBlockButtons> <apex:pageBlockTable value="{!cases}" var="c" id="pgbt"> <apex:column > <apex:commandButton value="Edit" action="{!Ed}" onclick="return OpenVfpage('{!c.id}')" /> </apex:column> <apex:column > <apex:inputCheckbox value="{!c.selected}"/> </apex:column> <apex:column value="{!c.con.contactid}"/> <apex:column value="{!c.con.priority}"/> <apex:column value="{!c.con.status}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> <script> function OpenVfpage(id) { var url = "/apex/selectedrecpage?id="+id; var newwin=window.open(url,'newPopup','_blank','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no'); if(window.focus) { newwin.focus(); } return false; } </script> </apex:page>
public with sharing class wrapperClassController { public wrapperclasscontroller(){ logid = UserInfo.getUserId(); } public String Logid {get; set;} public List<case> caset = new List<case>(); public String prior { set; } String qry = 'Select accountid, priority, status from case where priority=: selprio'; public List<selectoption> getprior() { List<selectoption> options = new List<selectOption>(); options.add(new selectOption('None','None')); options.add(new selectOption('Closed', 'Closed')); options.add(new selectOption('Open' , 'Open')); options.add(new selectoption('MyCases', 'MyCases')); /* for(case obj:[select priority from case]) { options.add(new selectOption(obj.priority,obj.priority)); }*/ return options; } public PageReference actsel() { if(selprio == 'Open') { caseList = new List<cCase>(); caset = [select id, Contactid, priority, status,isClosed from case where isClosed!= true]; for(Case c: caset) { cCase wrpopen = new cCase(c); caseList.add(wrpopen); } } if(selprio == 'Closed') { caseList = new List<cCase>(); caset = [select id, Contactid, priority, status from case where isClosed = true]; for(Case c: caset) { cCase wrpclosed = new cCase(c); caseList.add(wrpclosed); } } if(selprio == 'MyCases') { caseList = new List<cCase>(); caset = [select id, Contactid, priority, status, ownerid from case where ownerid =: logid]; for(Case c: caset) { cCase wrpclosed = new cCase(c); caseList.add(wrpclosed); } } return null; } public String selprio { get; set; } public List<cCase> caseList {get; set;} public List<cCase> getCases() { if(caseList == null) { caseList = new List<cCase>(); for(Case c: [select id, contactid, priority, status from case]) { caseList.add(new cCase(c)); } } return caseList; } public class cCase { public id id{get; set;} public Case con {get; set;} public Boolean selected {get; set;} public cCase(Case c) { con = c; selected = false; } } public PageReference Del() { return null; } public PageReference Ed() { return null; } }
Could you please post your selectedrecpage visualforce ?
Thanks :)