English 中文(简体)
• 如何在RichFaces有活力地重新雇用工人
原标题:how to get work rerendering elements with dynamicaly id in RichFaces

我的网页上有以下代码:

    <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....

a 4j:repeat loop i m establishing idactiveally,在id=“transportMeans InactiveCountryCode#{idx}”后添加了浏览指数。

但是,如果以这种方式确定婴儿,则以“回升”的方式重新接纳精英,“流动Means InactiveCountryCode#{idx}”则不作工作。

我如何解决这一问题?

问题回答

I think you have to remove the index from the ID attribute. Its auto generated with index for you.

to check this, run your page then view the page HTML source. you will find that the component id is like <form_name>-<id>-<index> Note: try to enclose your aj:repeat in side a





相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签