我有以下执行代码,但它给出了一些与 ajax 请求相关的问题。
actionListener 按钮点击调用
<a4j:commandButton value="Submit" alt="OligoWalk" styleClass="common_button" onclick="createNewLog();showProgressLayer();" oncomplete="parent.document.getElementById('resultFrm').src ='#{MyResearchView.resultToShow}';parent.reRenderLogSection();" actionListener="#{MyResearchView.executeTool}"> <f:attribute name="toolClass" value="com.sequerome.service.impl.tools.Oligowalk" />
<f:attribute name="toolId" value="#{ToolCustomeFormView.toolId}" /> <f:attribute name="toolName" value="#{ToolCustomeFormView.toolName}" /> <f:attribute name="inputParamFile" value="#{ToolCustomeFormView.inputParamFile}" />
<f:attribute name="paramMap" value="#{ToolCustomeFormView.toolParamBean.paramMap}" />
</a4j:commandButton>
A4j:js函数
<a4j:jsFunction name="createNewLog"
actionListener="#{MyResearchView.createNewLogEntry}"
oncomplete="parent.reRenderLogSection();executeTool();">
<f:attribute name="toolId" value="#{ToolCustomeFormView.toolId}" />
<f:attribute name="toolName" value="#{ToolCustomeFormView.toolName}"/></a4j:jsFunction>
- createNewLog() 函数必须先完成
- executeTool() 函数必须在那之后完成。
目前它以相同的方式调用,但 createNewLog() 函数的一半首先执行,然后它转到 executeTool() 函数。在这里它需要一些代码来执行,然后它再次转向 createNewlog() 函数。在此之后执行 createNewLog(),然后再次执行 executeTool()。
<a4j:commandButton value="Submit" alt="OligoWalk" styleClass="common_button" onclick="createNewLog();showProgressLayer();" oncomplete="parent.document.getElementById('resultFrm').src ='#{MyResearchView.resultToShow}';parent.reRenderLogSection();" actionListener="#{MyResearchView.executeTool}"> <f:attribute name="toolClass" value="com.sequerome.service.impl.tools.Oligowalk" />
<f:attribute name="toolId" value="#{ToolCustomeFormView.toolId}" /> <f:attribute name="toolName" value="#{ToolCustomeFormView.toolName}" /> <f:attribute name="inputParamFile" value="#{ToolCustomeFormView.inputParamFile}" />
<f:attribute name="paramMap" value="#{ToolCustomeFormView.toolParamBean.paramMap}" />
</a4j:commandButton>
<a4j:jsFunction name="createNewLog"
actionListener="#{MyResearchView.createNewLogEntry}"
oncomplete="parent.reRenderLogSection();executeTool();">
<f:attribute name="toolId" value="#{ToolCustomeFormView.toolId}" />
<f:attribute name="toolName" value="#{ToolCustomeFormView.toolName}"/></a4j:jsFunction>