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
Dipa87Dipa87 

How to get the ID of the selected record in enhanced list used in a vf page?

I am using apex:enhanced list to show list of accounts in a vf page. Each time on click of checkbox for a record I want to get the id of that particular record. i tried using jquery.But its not working. I tried some thing like this:

 

<apex:page >
<script type="text/javascript" src="{!URLFOR($Resource.jquery132js)}"/>
<script type="text/javascript" src="{!URLFOR($Resource.Jquery171)}"/>
<script type="text/javascript">
        
    var $j = jQuery.noConflict();
     $j(document).ready(function(){
     $j( ":checkbox" ).click(function( objEvent ){
            
               if(this.value!='')
               {
                   if(this.checked) {
                      
                       alert( this.value);
                          
                   }
                   else{alert('Unchecked----'+this.value);}
               }
                       
            });
             });
        
    </script>
 <apex:enhancedList type="account" height="400"/>
</apex:page>

If you have any other javascript or jquery code to capture the click event of checkbox which can solve this problem. please share .

Thanks in advance.