首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >actionFunction的Oncomplete事件不工作

actionFunction的Oncomplete事件不工作
EN

Stack Overflow用户
提问于 2016-08-10 21:01:35
回答 1查看 5.1K关注 0票数 0

我已经创建了一个visualforce页面,它使用jQuery调用函数并创建弹出窗口。ActionFunction标记使用一个调用jQuery函数的Oncomplete事件。

现在我正在尝试制作两个弹出窗口,但actionFunction的Oncomplete事件不起作用。

代码语言:javascript
复制
<apex:page controller="DataCleanUp" showHeader="false" sidebar="false"> 
    <apex:includeScript value="{!$Resource.jQueryPlugin}"/>

    <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"/>
    <apex:stylesheet value="{!URLFOR($Resource.bootstrap_sf1_beta16, 'bootstrap-sf1-0.1.0-beta.16/dist/css/bootstrap.css')}" />
    <script src = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.js"/> 

      <script>

        j$=jQuery.noConflict();
        j$(document).ready(function(){
            j$("#popUp").dialog({autoOpen:false,model:true,position:'center',width: 1000});

        });
        function showDialog(depenList){
            j$("#dependentObj").html(depenList);
            j$("#popUp").dialog("open");
            j$("#popUp").dialog("option","title","Number of Records");
            j$("#popUp").dialog('option','position','center');
            return false;
        }

     </script>

     <apex:form >
         <apex:pageMessages ></apex:pageMessages>
         <apex:actionFunction action="{!checkAllStd}" name="checkStd" reRender="standardTable"/>
           <apex:actionFunction action="{!checkAllCustom}" name="checkCus" reRender="customTable"/>  
           <apex:actionFunction action="{!QueryCount}" name="countObj"  oncomplete="return showCount('{!count}');" reRender="example">
                <apex:param name="objCount" value="" id="RecordsCount" assignTo="{!objCount}"/>
           </apex:actionFunction>
           <apex:pageBlock title="Standard Data Clean Up" >
               <apex:pageBlockSection id="pageId" title="Standard Objects" columns="4" collapsible="true">
                   <apex:pageBlockTable value="{!standardWrapObjList}" var="wObj"  id="standardTable" align="center" title="Standard Objects" styleClass="table">
                       <apex:column >
                           <apex:facet name="header" ><apex:inputCheckbox onclick="checkStd()" value="{!standardFlag}"/></apex:facet>
                           <apex:inputCheckbox value="{!wObj.isSelected}" id="InputId" label="Object Name"/> 
                       </apex:column>
                       <apex:column > 
                           <apex:facet name="header" >Object Name</apex:facet> 
                           {!wObj.objName} 
                       </apex:column>
                       <apex:column > 
                           <apex:facet name="header" >Number of Records</apex:facet> 
                           <apex:outputLink onclick="countObj('{!wObj.objName}');return false; " >
                               See Number of Records
                           </apex:outputLink>
                           </apex:column>
                     </apex:pageBlockTable>
               </apex:pageBlockSection>
               <apex:pageBlockButtons >
                <apex:commandButton value="Delete"  action="{!dependentStdtObjList}"    oncomplete="return showDialog('{!depenStdList}');"/>
                <apex:commandButton action="{!cancleStandardDelete}" value="Cancle"/>
                    <apex:commandButton action="{!deleteStdRecords}" value="confirm" />

               </apex:pageBlockButtons>
         </apex:pageBlock>
         <apex:pageBlock title="Custom Data Clean Up" >
             <apex:pageBlockSection id="pageId" title="Custom Objects" columns="4" collapsible="true">
                 <apex:pageBlockTable value="{!customWrapObjList}" var="wObj"  id="customTable" align="center" title="Custom Objects" styleClass="table" >
                     <apex:column >
                        <apex:facet name="header" ><apex:inputCheckbox onclick="checkCus()" value="{!customFlag}"/></apex:facet> 
                         <apex:inputCheckbox value="{!wObj.isSelected}" id="InputId" label="Object Name"/> 
                     </apex:column>
                     <apex:column > 
                         <apex:facet name="header" >Object Name</apex:facet> 
                           {!wObj.objName} 
                     </apex:column>
                     <apex:column > 
                         <apex:facet name="header" >Number of Records</apex:facet> 
                         <apex:outputLink onclick="countObj('{!wObj.objName}')">
                               See Number of Records
                         </apex:outputLink>
                     </apex:column>
                 </apex:pageBlockTable> 
             </apex:pageBlockSection>
             <apex:pageBlockButtons >
                <apex:commandButton value="Delete"  action="{!dependentCustObjList}"  reRender="pageId"  oncomplete="return showDialog('{!depenCustomList}')"/>
                <apex:commandButton action="{!cancleCustomDelete}" value="Cancle"/>
                <apex:commandButton action="{!deleteCusRecords}" value="confirm" />
            </apex:pageBlockButtons>
         </apex:pageBlock>
         <div id ="popUp">
         <div style = "float:left" >This object's records are also getting deleted</div>
         <div id = "dependentObj"></div>
         </div>
         <apex:pageBlock id="example"></apex:pageBlock>
    </apex:form>
</apex:page>
EN

回答 1

Stack Overflow用户

发布于 2016-08-10 23:39:27

您没有正确使用操作函数,我建议您阅读文档并在Salesforce Stack中发布此问题

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionFunction.htm

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38874208

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档