.jspページの次のコードがあります。
<f:view>
<div class="portletBody">
<h:form id="editSectionForm" onsubmit="return numCheck(document.forms[0].elements['editSectionForm:sectionTable:0:maxEnrollmentInput'].id)">
<sakai:flowState bean="#{editSectionBean}"/>
<t:aliasBean alias="#{viewName}" value="editSection">
<%@ include file="/inc/navMenu.jspf"%>
</t:aliasBean>
<h3><h:outputText value="#{msgs.edit_section_page_header}"/></h3>
<%@ include file="/inc/globalMessages.jspf"%>
<t:aliasBean alias="#{bean}" value="#{editSectionBean}">
<%@ include file="/inc/sectionEditor.jspf"%>
</t:aliasBean>
<t:div styleClass="act">
<h:commandButton
action="#{editSectionBean.update}"
value="#{msgs.update}"
styleClass="active"
onclick="reEnableLimits();" />
<h:commandButton action="overview" value="#{msgs.cancel}" immediate="true" />
</t:div>
</h:form>
</div>
</f:view>
/inc/sectionEditor.jspfファイルで実行されるjavascriptコードがいくつかあります。sectionEdtiorファイルのそのコードのいくつかでは、どういうわけかこのフォームのIDを取得する必要があります。editSectionForm。/inc/sectionEditor.jspfコードは複数のページで実行されるため、ハードコーディングできません。
そのため、現在のフォームのIDを取得できるようにするには、/ inc/sectionEditor.jspfのjavascriptコードが必要です。
すなわち:
editSectionFormページを表示している場合は、そのページにいることを通知します。addSectionFormページを表示している場合は、そのページにいることを通知します。