• hacksawblade16
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 41
    Replies

i have checkboxes in column header inside pageblocktable. I rerender the table when the checkbox is checked.after rerendering i want the checkbox to remian in the checked state,but it gets unchecked.How can i keep it checked??

I want to call  methods in controller depending on whether checkbox is checked and how many checkboxes are checked. .I have 2 checkboxes.

Initially by default both checkboxes must be checked.

and callMethod1() when both  checkboxes are checked

2)callMethod2() when first checkbox is checked and second is unchecked

3)callMethod3() when second checkbox is checked first is unchecked.

 

A brief idea on what i'm actually doing here

I have a PageBlocktable with two columns

The column headers are NAME and ADDRESS each with a checkbox

If both NAME and ADDRESS checkboxes are selected,the Name and address will be displayed.

If only the NAME checkbox is checked then only names are displyed and ADDRESS column is empty

If only the ADDRESS checkbox is checked then only address are displayed and NAME column is empty

 

 

 

 

can somebody give me an example for passing boolean value from jquery in a visual force page to controller using param and action function.I'm getting this error after executing the following code...

Error: conversionTrialController Compile Error: Illegal assignment from String to Boolean at line 393 column 9

<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>

 

 <script type="text/javascript">

        var j$ = jQuery.noConflict();       

        j$(document).ready(function(){

   }); 

 

 

function orgChkBoxesSelected()

        {

var orgName=j$('#chk_org_name').is(":checked");

alert(orgName);

var orgAddr=j$('#chk_org_addr').is(":checked");

         

          getorgCheckedBox(orgName,orgAddr)       

        } 

         

 

 

 

<apex:actionFunction name="getorgCheckedBox" action="{!getCheckedOrgBoxes}" reRender="orgBlock">

 <Apex:param name="orgNames" value=""/>

 <Apex:param name="orgAddrs" value="" />

<Apex:actionFunction/>

 

 

 

public void getCheckedOrgBoxes()

 {

Boolean org_Name=Apexpages.currentPage().getParameters().get('orgNames');----------->>>>line 393 column 9

Boolean org_Addr=Apexpages.currentPage().getParameters().get(‘orgAddrs’);

 

organization=leadUtility.getorganization(org_Name,org_Addr);

     return NULL;     

I have checkedboxes in column headers....

            

<apex:column value="{!houses.name}">

                 <apex:facet name="header"><apex:inputCheckbox selected="{!chkhousehold_lname}">Name</apex:inputCheckbox>

                     <Apex:actionSupport event="onchange"  action="{!householdInputCheck}" rerender="hldSection" />

                 </apex:facet>

                

             </apex:column>

 

 

How can i get the checkbox values  and get which all checkboxes are checked.

 

 

 

When i execute this code.My checkboxes become invisible.How can i overcome it?

 

 

<apex:column value="{!houses.name}">
               <apex:facet name="header"><apex:

inputCheckbox selected="{!chkhousehold_lname}">Name</apex:inputCheckbox>
                      <Apex:actionSupport event="onchange"  action="{!householdInputCheck}" rerender="hldSection" />
               </apex:facet>
 </apex:column>

<apex:column value="{!houses.name}">
                 <apex:facet name="header"><apex:inputCheckbox value="{!chkhousehold_lname}">Name</apex:inputCheckbox>
                 <Apex:actionSupport event="onchange"  action="{!householdInputCheck}" rerender="hldSection" />
                 </apex:facet>
             </apex:column>

 

 

By doing this my checkboxes are getting vanished and i cant select the checkbox

How can i insert checkbox into the colum header like the IsActive  header with checkbox

var orgRadioData= j$('input[name=pradios]:radio:checked').val();

<input type="radio"  value="{!ppls.id}"  name="pradios"/>

 

How can i make the first radio button of the family checked by default

How can i insert checkboxes horizontally in the header of a column???

How do i display a list of wrapper class objects with radio buttons

By doing this i can display contact names and account name in different columns.I want to display both under one column with the heading of that column as NAME

public class tt
{
    public List<Account> accLst {get; set;}
    public List<Contact> conLst {get; set;}
    public List<MyWrapper> wrapper {get; set;}

    public tt()
    {
        accLst = [select id,name from account   ] ;
        conLst = [select id,name from contact   ] ;
        wrapper = new List<MyWrapper>() ;
        for(Integer i=0 ;i<20;i++)
            wrapper.add(new MyWrapper(accLst[i] , conLst[i])) ;
    }
    
    public class MyWrapper
    {
        public Account accRec {get; set;}
        public Contact conRec {get; set;}
        
        public MyWrapper(Account acc , Contact con)
        {
            accRec = acc ;
            conRec = con ;
        }
    }
}



VisualForce Page
 
<apex:page controller="tt">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:pageBlockTable value="{!wrapper}" var="wrap">
                <apex:column headerValue="Account Name" value="{!wrap.accRec.Name}"/>
                <!-- you can add related fields here   -->
                <apex:column headerValue="Contact Name" value="{!wrap.conRec.Name}"/>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
 
 
 
 

can someone please  show an example of use of breakbefore in column tag?

in my project leads are the prospects and contacts are the people.. I'm basically converting the prospect(lead) into people(contact) and before converting i need to check if the prospect(lead) already exists as people(contact) or not to avoid duplicate records,For this purpose  i use  prospect(lead) record first name soundex to match with people(contact) record first name soundex.The result will be a list of matching people(contact)records which i need to display on the VF page. On the VF page i must display a list in  which The prospect(lead) whom I'm trying to convert must be displayed as the first row of this list and second row onwards the matching people list will begin. Each row in the list will have a corresponding radio button.

 

 


                             first name       last name       company
radiobutton1)          jack                sparrow          infosys-------:>(prospect) lead record
radiobutton2)          jack                mathews        salesforce----->matching people (contact)record based on first name of prospect(lead) record
radiobutton3)          jack                fernandes       IBM -------------->matching people(contact) record based on first name

I need to display a list on visual force page in which the first record in the list is a  lead object record and the next is the list of people object records.Every record in the list will have a radio button attached to it and the selected record should be passed to my controller.

can yanyone  tell me how can i display the fields of custom object on vf page along with checkboxex attached to each field.Can i use param and assign to for this??if yes can anyone show me an example

i'm not able to fetch the if from the salesforce page into my visual force page

 

 

 

public with sharing class conversionrtestclass {
        
        
        public  list<organization> org=new list<organization>();
        Prospect__c  leadList =new Prospect__c();
        LeadDedupUtility leadUtility;
        public string id;
        
        
      public   Prospect__c  getleadList()
        {
            return leadList;
        }
        
      public  list <Organization> getorg()
        {
            return org;
        }
        
        
      public string getid()
        {
            return id;
        }
     
     
       
        public conversionrtestclass(ApexPages.StandardController stdController)
        {
        
                
                   leadUtility=new LeadDedupUtility();
                   //this.leadList  = ( Prospect__c )stdController.getRecord();
               //this.id=ApexPages.currentPage().getParameters().get(id);
                 id= 'a0Jc00000032sxs';
                   system.debug('Requested ID--->'+id);
                   
                   leadList =leadUtility.getProspect(id);
                   org=leadUtility.getorganization();
                       //selected=FALSE;
                  
                   //org=leadUtility.getorganization();
                  // system.debug('Requested object is--->'+org);
        }
      
      



}

System.NullPointerException: Attempt to de-reference a null object 
Class.LeadDedupUtility.getorganization: line 29, column 1
Class.conversionrtestclass.<init>: line 44, column 1

 

 string soundxforName=soundxObj.getSoundxNumber(prospectDetails.Name,6);---> this is Class.LeadDedupUtility.getorganization: line 29, column 1

 

 

my controller code is

 

 

 

 

 

public with sharing class conversionrtestclass {
        
        
        public  list<organization> org=new list<organization>();
        public SoundxNumberGenerator x=new SoundxNumberGenerator();
       
        Prospect__c  leadList =new Prospect__c();
        LeadDedupUtility leadUtility;
        public string id;
        
        
      public   Prospect__c  getleadList()
        {
            return leadList;
        }
        
      public  list <Organization> getorg()
        {
            return org;
        }
        
        
      public string getid()
        {
            return id;
        }
     
     
       
        public conversionrtestclass(ApexPages.StandardController stdController)
        {
        
                
                   leadUtility=new LeadDedupUtility();
                   this.leadList  = ( Prospect__c )stdController.getRecord();
                   ApexPages.currentPage().getParameters().get(id);
                   
                       //system.debug('Requested ID--->'+id);
                   
                   leadList =leadUtility.getProspect(id);
                       
                       //selected=FALSE;
                  
                   org=leadUtility.getorganization();---------------->>>>>this line 44 colum 1
                   system.debug('Requested object is--->'+org);
        }
      
      



}

how can i put checkboxes for <apex:outputfield> ?? the outfield contains fields from my standard controller ..i need to attach those fields with checkboxes

there is a convert button present on the prospect(Lead) page .When the user hits the convert button the fields of the prospect should be displayed on another   visual page along with the checkbox.How can i do this??

 

This is my code
.Where am i going wrong

 

 

 

 

<apex:page StandardController="Prospect__c" extensions="conversionrtestclass">

<apex:pageBlock >
<!--<apex:param name="id" value="{!id2}"/>-->
<apex:detail subject="{!id2}" />
</apex:pageblock>

<apex:pageBlock >
<apex:PageBlockSection title="People">
</apex:PageBlockSection>
<apex:pageBlockSection title="Household">
</apex:pageBlockSection>
<apex:pageBlockSection title="organisation">
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>

 

 

 

 

 

 

 

public with sharing class conversionrtestclass {
        
        Prospect__c  leadList =new Prospect__c();
        LeadDedupUtility leadUtility;
       //public Prospect__c  myLead;
        public Id id;
        public Id id2;
        
        public ID getid()
        {return id;}
      public ID getid2()
        {return id2;}
     
       /* public Prospect__c setmyLead()
        {
        return myLead;
        }*/
        public conversionrtestclass(ApexPages.StandardController stdController)
        {
        
                
                 leadUtility=new LeadDedupUtility();
                  //this.leadList  = ( Prospect__c )stdController.getRecord();
                // this.id= ApexPages.currentPage().getParameters().get(id);
                      this.id=(Id)stdController.getId();               
                      this.id2=leadUtility.getProspect(id);
              
        }


}

 

 

 

can somebody explain me what is the significance of this statement "ApexPages.currentPage().getParameters().get('id');" what exactly happens and how it happens

i have checkboxes in column header inside pageblocktable. I rerender the table when the checkbox is checked.after rerendering i want the checkbox to remian in the checked state,but it gets unchecked.How can i keep it checked??

can somebody give me an example for passing boolean value from jquery in a visual force page to controller using param and action function.I'm getting this error after executing the following code...

Error: conversionTrialController Compile Error: Illegal assignment from String to Boolean at line 393 column 9

<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"/>

 

 <script type="text/javascript">

        var j$ = jQuery.noConflict();       

        j$(document).ready(function(){

   }); 

 

 

function orgChkBoxesSelected()

        {

var orgName=j$('#chk_org_name').is(":checked");

alert(orgName);

var orgAddr=j$('#chk_org_addr').is(":checked");

         

          getorgCheckedBox(orgName,orgAddr)       

        } 

         

 

 

 

<apex:actionFunction name="getorgCheckedBox" action="{!getCheckedOrgBoxes}" reRender="orgBlock">

 <Apex:param name="orgNames" value=""/>

 <Apex:param name="orgAddrs" value="" />

<Apex:actionFunction/>

 

 

 

public void getCheckedOrgBoxes()

 {

Boolean org_Name=Apexpages.currentPage().getParameters().get('orgNames');----------->>>>line 393 column 9

Boolean org_Addr=Apexpages.currentPage().getParameters().get(‘orgAddrs’);

 

organization=leadUtility.getorganization(org_Name,org_Addr);

     return NULL;     

<apex:column value="{!houses.name}">
                 <apex:facet name="header"><apex:inputCheckbox value="{!chkhousehold_lname}">Name</apex:inputCheckbox>
                 <Apex:actionSupport event="onchange"  action="{!householdInputCheck}" rerender="hldSection" />
                 </apex:facet>
             </apex:column>

 

 

By doing this my checkboxes are getting vanished and i cant select the checkbox

var orgRadioData= j$('input[name=pradios]:radio:checked').val();

<input type="radio"  value="{!ppls.id}"  name="pradios"/>

 

How can i make the first radio button of the family checked by default

How can i insert checkboxes horizontally in the header of a column???

By doing this i can display contact names and account name in different columns.I want to display both under one column with the heading of that column as NAME

public class tt
{
    public List<Account> accLst {get; set;}
    public List<Contact> conLst {get; set;}
    public List<MyWrapper> wrapper {get; set;}

    public tt()
    {
        accLst = [select id,name from account   ] ;
        conLst = [select id,name from contact   ] ;
        wrapper = new List<MyWrapper>() ;
        for(Integer i=0 ;i<20;i++)
            wrapper.add(new MyWrapper(accLst[i] , conLst[i])) ;
    }
    
    public class MyWrapper
    {
        public Account accRec {get; set;}
        public Contact conRec {get; set;}
        
        public MyWrapper(Account acc , Contact con)
        {
            accRec = acc ;
            conRec = con ;
        }
    }
}



VisualForce Page
 
<apex:page controller="tt">
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:pageBlockTable value="{!wrapper}" var="wrap">
                <apex:column headerValue="Account Name" value="{!wrap.accRec.Name}"/>
                <!-- you can add related fields here   -->
                <apex:column headerValue="Contact Name" value="{!wrap.conRec.Name}"/>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
 
 
 
 

in my project leads are the prospects and contacts are the people.. I'm basically converting the prospect(lead) into people(contact) and before converting i need to check if the prospect(lead) already exists as people(contact) or not to avoid duplicate records,For this purpose  i use  prospect(lead) record first name soundex to match with people(contact) record first name soundex.The result will be a list of matching people(contact)records which i need to display on the VF page. On the VF page i must display a list in  which The prospect(lead) whom I'm trying to convert must be displayed as the first row of this list and second row onwards the matching people list will begin. Each row in the list will have a corresponding radio button.

 

 


                             first name       last name       company
radiobutton1)          jack                sparrow          infosys-------:>(prospect) lead record
radiobutton2)          jack                mathews        salesforce----->matching people (contact)record based on first name of prospect(lead) record
radiobutton3)          jack                fernandes       IBM -------------->matching people(contact) record based on first name

can yanyone  tell me how can i display the fields of custom object on vf page along with checkboxex attached to each field.Can i use param and assign to for this??if yes can anyone show me an example

can somebody explain me what is the significance of this statement "ApexPages.currentPage().getParameters().get('id');" what exactly happens and how it happens