a4j:commandButton未达到oncomplete

时间:2013-12-27 06:19:22

标签: java javascript ajax jsf richfaces

我正在使用Richfaces 3.3.3Final,有时a4j:commandButton操作未完成, 没有更多页面重新出现。

示例代码:

<a4j:commandButton image="#{Icon.gotoIcon}"
                   id="gotoLinkId"                                                       
                   action="#{Home.gotoLinkAction}"
                   oncomplete="linkExpand('#{Home.id}');"
                   reRender="modalPanel,navigationMenu"/>

按钮点击操作后,panelMenuGroup将自动展开,但有时页面被挂起。并试图清除饼干,没有效果。

<rich:panelMenuGroup id="groupId"
                     label="About"
                     action="#{Home.homeLinkAction}"
                     expandMode="ajax"
                     reRender="navigationMenuId">

    <!-- Development -->

    <rich:panelMenuItem>
        <a4j:commandLink id="developmentMenuId"
                         value="Development"
                         action="#{Home.developmentMenuAction}"
                         reRender="mainOutputPanelId">
            <f:param id="ParamId" name="nameId" value="Development"/>
        </a4j:commandLink>
    </rich:panelMenuItem>
</rich:panelMenuGroup>

脚本:

function linkExpand(id)
   {
       var elementId = "iconNavigationId:"+id;
       document.getElementById(elementId).click();
   }

当我尝试手动展开panelMenuGroup时,不应再完成任何操作。我得到了以下例外,

例外:

debug[15:47:22,701]: Script evaluation succeeded
debug[15:47:22,701]: Evaluate script replaced area in document: 
error[15:47:22,717]: . Error message: Invalid argument.
debug[15:47:22,717]: call selectSingleNode for id= org.ajax4jsf.oncomplete
debug[15:47:22,732]: Call request oncomplete function after processing updates
debug[15:47:22,748]: call selectSingleNode for id= _ajax:data

1 个答案:

答案 0 :(得分:0)

oncomplete的el-expressoins会尽早评估。请改用jsFunction。