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
ashu 6112ashu 6112 

Wrapper pop-up

HI,
My requirement is that I am using the wrapper class to display records of the Account along with checkbox(lets take 10 records), Now if I select any 3 checkboxes randomly, then the accounts record asociated with these checkbox reflected in other table. It is done and working as expected.
Now I have to add some more functionality in it. Example: If we select any of the two records and click on button(say update) then those 2 selected accounts open in pop-up window in Edit mode, and from there I can update these 2 account record(that we selected previously) and again in this pop-up window, there should be a button(lats say save), when we click on save button after updateing those 2 records, these account records must have been updated on its detail page.

Please suggest.
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for wrapper sample code
1) http://amitsalesforce.blogspot.com/2016/03/wrapper-class-in-salesforce-select-all.html

Please check below post for pop-up sample code
1) http://amitsalesforce.blogspot.com/2015/07/custom-popup-in-salesforce-visualforce.html

Let us know if this will help you
 
ashu 6112ashu 6112
Hi Amit, 

Thanks for this, but my requirement is different. I have already implemented all this that is given in this link you provided. I need to add more functionality as mentioned.
ashu 6112ashu 6112
Code that I have written is:
Controller Class:

public class ContactWrapper 
{

 public List<wrapcon> wcon{get;set;}
 public List<wrapcon> wconn{get;set;} 
    public void display() {
        wconn.clear();
        for(wrapcon cc:wcon)
         {
         if(cc.chkbx)
         {
         wconn.add(cc);
         }
    }
}
 public ContactWrapper()
 {
     wcon= new List<wrapcon>();
     wconn= new List<wrapcon>();
     for(Contact c : [select name from Contact LIMIT 10])
     {
     wcon.add(new wrapcon(c));
     }
     
     
 }   
    public class wrapcon
        {
            public Contact con{get;set;}
            public boolean chkbx{get;set;}
            
            public wrapcon(Contact c)
            {
                con = c;
                chkbx = false;
            }    
        }
}

*************************************

VF Page:

<apex:page controller="ContactWrapper">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection columns="3">
                <apex:pageBlockTable value="{!wcon}" var="wc">
                    <apex:column >
                        <apex:inputCheckbox value="{!wc.chkbx}"/>
                    </apex:column>
                    <apex:column value="{!wc.con.name}"/>
            </apex:pageBlockTable>
            <apex:commandButton value="Display" action="{!display}" reRender="tb2"/>
                <apex:pageBlockTable id="tb2" value="{!wconn}" var="wcc">
                    <apex:column value="{!wcc.con.name}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>