0

this is what I have

<h:body>
            <ui:repeat id="repeatBlockId" var="dataItem" value="#{backingBean.dataList}">

                <custom:myComp id="myCompId" name="#{dataItem.name}"/>

            </ui:repeat>
    </h:body>

and here the composite component

<composite:implementation xmlns:custom="http://java.sun.com/jsf/composite/components">

        <ui:param name="name" value="#{cc.attributes.name}"/>

        <h:panelGroup id="toBeRefreshedId">
        #{backingBean.randomNumber}
        </h:panelGroup>    

        <h:form id="myFormId">
                <br/>#{name}
                <h:commandButton>Refresh
                    <f:ajax render=":#{cc.clientId}:toBeRefreshedId" />
                </h:commandButton>
            </h:form>

    </composite:implementation>

Whatever I try, I don't get it done to update the sibling of the form. I always get the following error message:

<f:ajax> contains an unknown id ':repeatBlockId:0:myCompId:toBeRefreshedId' - cannot locate it in the context of the component j_idt6

I also tried to simply refresh the whole composite block with <f:ajax render=":#{cc.clientId}" /> resulting in the same error message ...unknown id ':repeatBlockId:0:myCompId'....

Vincent
  • 470
  • 6
  • 13
  • I think that it should have a container involving the `toBeRefreshedId` panel and the `h:form` something like: ` ......... ` – Jorge Campos Jul 28 '14 at 16:43
  • Thank you for your quick response. unfortunately that doesn't work either. I get ` contains an unknown id ':repeatBlockId:0:compId:superIdToBeRefreshed:toBeRefreshedId' - cannot locate it in the context of the component j_idt6` – Vincent Jul 28 '14 at 16:52
  • Would you be able to wrap the `h:panelGroup` into the form? Then a `render="toBeRefreshedId"` should work, since the id would be relative for the form. Also try as you have right now but wrapping your whole `composite:implementation` content with a `div id="#{cc.clientId}"`. Remember the id declarations for ajax work just with the client side id as it is, so inspecting the DOM tree in the browser and seeing how the ids are being generated will be helpful for you too. – Aritz Jul 29 '14 at 19:58
  • Thanks for your help. Unfortunately wrapping all within the `` is not an option since the example above is only simplified. I actually have another form within the ``. I checked the document tree. The panel group is rendered as ``. Wrapping all in a div with `
    ` didn't work either. The only thing that really works is wrapping the whole `` within a `` and render that one. Though this not really satisfying.
    – Vincent Aug 04 '14 at 21:40

0 Answers0