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
Feng_WFeng_W 

javascript in enhancedist oncomplete attribute is not firing????

i had a very simple tab page within a tab panel like this

<apex:panelGrid id="pnlGrid" width="100%">

 

<apex:enhancedList type="Case" height="700" rowsPerPage="100"  oncomplete="alert('abc');" />

 

</apex:panelGrid>

however the javascript  oncomplete="alert('abc');" is not firing when the enhancedList completes rendering...

 

anyone  has an idea?

 

thanks in advance

TehNrdTehNrd

I just hit this same issue today. It does not execute on initial load. Only when the view is changed. Seems like a bug.

Feng_WFeng_W

I am not sure it is a bug or not, if you change the filter in the enhancedlist , the oncomplete event will fire, but it will not fire when first time load the enhancedlist :(

TehNrdTehNrd

I came up with this work around.

 

<apex:page standardController="Opportunity" recordSetvar="opportunities" id="page" >
    <apex:enhancedList type="Opportunity" height="735" rowsPerPage="25" id="enhancedList"/>
 
    <script type="text/javascript">
        isListLoaded();
        
        function isListLoaded(){
            var list = document.getElementsById("page:enhancedList_wrapper");
            
            if(list.length == 0){
                //Enhanced list hasn't loaded yet, check again shortly.
                 setTimeout("isListLoaded()",200);
            }else{
                //alert('List has loaded');
            }
        }
    </script>
</apex:page>