私のプロジェクトにプライムフェイスを使用しています。ループ内でオートコンプリートを使用しているときに問題に直面しています。forEach ループ内には、出力ラベルとオートコンプリート タグがあります。forEach ループの「items」属性を HashMap にマップし、マップ サイズに従ってループを反復し、outputlabel と autocomplete をレンダリングしました。出力ラベルは順番にレンダリングされますが、オートコンプリートは同じ位置にレンダリングされます (互いに重なり合います)。
どんな助けでも大歓迎です。
<div style="margin-top: 2.3%;">
<c:forEach var="attachMap" items="#{searchAccountBean.attachmentMap}">
<h:outputText style="margin-top:4%" value="#{attachMap.key}"></h:outputText>
<p:autoComplete value="#{searchAccountBean.attachmentMap[attachMap.key]}"
id="autoId_#{attachMap.key}"
completeMethod="#{searchAccountBean.completeAccountName}"
var="p" itemLabel="#{p}" itemValue="#{p}" forceSelection="true"
size="15" style="margin-top:2.5%;"
scrollHeight="80" minQueryLength="1" title="Enter Account Name">
<p:ajax event="itemSelect" listener="#searchAccountBean.handleSelectAccount}"></p:ajax>
<p:ajax event="blur"></p:ajax>
</p:autoComplete>
<p:spacer width="30px" ></p:spacer>
</c:forEach>
</div>