0

I have

<h:panelGroup>
     <ui:repeat value="#{requests.filters}" var="filter">
          <custom:filter filter="#{filter}" update="j_requests"/>
     </ui:repeat>
     <h:panelGroup id="j_requests">
     <h:outputText value="Запросы журналистов:"/>
     <custom:requestList id="allrequests" data="#{requests.getRequests()}"/>
</h:panelGroup>

and it works fine on localhost computer but on other computer loading of page fail with exception: avax.faces.FacesException: <f:ajax> contains an unknown id 'j_requests' - cannot locate it in the context of the component j_idt20_filters it seems that j_requests is not visible inside ui:repeat? but how it works on develop machine? here is filter composite component:

<cc:interface>
    <cc:attribute name="update"/>
    <cc:attribute name="filter" type="ru.rs.corhub.web.filters.RegionBoxFilter"/>
</cc:interface>
<cc:implementation>
    <h:form>
        <h:outputText value="#{cc.attrs.filter.name}:"/>
        <h:selectManyCheckbox id="#{cc.attrs.id}_filters" value="#{cc.attrs.filter.selectedCriterias}" converter="regionConverter">
            <f:selectItems value="#{cc.attrs.filter.criterias}" var="item" itemLabel="#{item.value()}" itemValue="#{item}"/>
            <f:ajax render="#{cc.attrs.update}" listener="#{requests.populateFilteredList()}"/>
        </h:selectManyCheckbox>
    </h:form>
</cc:implementation>
Vadim
  • 105
  • 1
  • 9

1 Answers1

0

Since you have a h:form - which is a NamingContainer - inside your custom component all the ids of the elements inside get prefixed with the id of that form. So when you put an relative id into update-property the component will not be found, because there is not component with id j_requests inside that form. To overcome this you can use an absolute id by prefixing the id with :, i.e. update=":j_requests".

user1983983
  • 4,793
  • 2
  • 15
  • 24