実行用の次のコードがありますが、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>