我的表单在 ui:repeat 组件中包含一个下拉列表。选择任何列表项目时,f:ajax调用触发了两个下拉列表和UI中的其他几个组件的刷新:重复。我正在努力为 f:ajax render="???????" 找出正确的 id 格式 (见下面的小面视图)。任何帮助,将不胜感激。
我提供了渲染屏幕的原始源视图(实际的 JSF id)和一个显示与编码相同的组件的 facelet 视图。
浏览器源代码视图
<form id="GeneralMedicalHistory" name="GeneralMedicalHistory" method="post" action="..."
<span id="GeneralMedicalHistory:GeneralMedicalHistory_P">
<span id="GeneralMedicalHistory:medhist">
<table border="0" class="table_form">
<select id="GeneralMedicalHistory:RPTK:0:MedicalCondition" name="GeneralMedicalHistory:RPTK:0:MedicalCondition" > ---> TARGET ID (UI:REPEAT)
小面视图
<h:form id ="GeneralMedicalHistory">
<h:panelGroup id="GeneralMedicalHistory_P">
<h:panelGroup id="medhist">
<ui:repeat value="#{f.repeatingItemGroups['MedicalHistory'][1]}" var="repeatKey" id="RPTK" >
<h:commandLink action="remove_repeating_ig" rendered="${f.items[removeOid].isNew and repeatKey != '1'}"></>
<table border="0" class="table_form">
<h:selectOneMenu value="${f.items[oid].value}" id="MedicalCondition" >
<f:selectItems value="${f.items[oid].codeListItems}"/>
<f:ajax render="?????????" event="click" listener="#{f.clearModelValuesViaAjax}" />
</h:selectOneMenu>
</table>
</h:panelGroup>
</h:panelGroup>
</h:form>
我尝试了以下但没有一个工作......
- f:ajax render="GeneralMedicalHistory:RPTK:0:MedicalCondition"
- f:ajax render=":GeneralMedicalHistory:RPTK:0:MedicalCondition"
- f:ajax render="GeneralMedicalHistory_P:medhist:RPTK:0:MedicalCondition"
- f:ajax render=":GeneralMedicalHistory_P:medhist:RPTK:0:MedicalCondition"
- f:ajax render="GeneralMedicalHistory:GeneralMedicalHistory_P:medhist:RPTK:0:MedicalCondition"
- f:ajax render=":GeneralMedicalHistory:GeneralMedicalHistory_P:medhist:RPTK:0:MedicalCondition"