我的页面上有以下代码:
<a4j:repeat value="#{tdController.cu.esaDoutCUConsigment.esaDoutCUDepartureArrivalTransport.transportMeans}" var="transportMean" rowKeyVar="idx">
<tr>
<td>
<rich:autocomplete id="transportMeansInactiveCountry#{idx}" mode="cachedAjax"
autocompleteMethod="#{countryList.autoComplete}"
minChars="1" layout="grid"
var="country" fetchValue="#{country.code}" width="50px"
inputClass="autoCompleteWidth20"
immediate="true" autofill="true"
value="#{transportMean.country}"
converter="com.enfasis.eced.common.controller.converter.CountryConverterAutoComplete">
<h:outputFormat value="{0}({1})">
<f:param value="#{country.name}"/>
<f:param value="#{country.code}"/>
</h:outputFormat>
<a4j:ajax event="selectitem" execute="@this"
render="transportMeansInactiveCountryCode#{idx}"/>
</rich:autocomplete>
<h:outputText id="transportMeansInactiveCountryCode#{idx}"
value="#{transportMean.country.name}" style="margin-left:5px"/>
</td>
...
</a4j:repeat....
在 a4j:repeat 循环中,我通过在 id 名称末尾添加行索引来动态设置 id,例如 id="transportMeansInactiveCountryCode#{idx}"。
但是当我以这种方式设置 id 时,使用 id="transportMeansInactiveCountryCode#{idx}" 重新渲染元素不起作用。
我怎么解决这个问题?