2

The best way to illustrate what i'm trying to do is just give an example:

<h:form prependid="false" >
    <h:panelGroup id="layer1">
        <ui:repeat>
            <h:panelGroup id="layer2>
                <ui:repeat>
                    <h:panelGroup id="layer3">
                        <h:commandButton>
                            <f:ajax render="layer2" execute="@form" />
                        </h:commandButton>
                    </h:panelGroup>
                </ui:repeat>
            </h:panelGroup>
        </ui:repeat>
    </h:panelGroup>
</h:form>

When pressing the h:commandButton in the example above I get an exception from JSF saying that the ID layer2 does not exists.

How can I do this correctly?

Thanks!

Ben
  • 10,020
  • 21
  • 94
  • 157

1 Answers1

2

The following should work out for this:

<f:ajax render=":#{component.parent.parent.parent.parent.clientId}:layer2" execute="@form" />

It works in MyFaces only, not in Mojarra (yet). Its <ui:repeat> is broken in many ways.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Great Thanks! (Using MyFaces) I wish there was a more "streamlined" way of doing this.. – Ben Oct 19 '11 at 15:33
  • I too. Note that `render=":#{component.parent.parent.parent.clientId}"` should in theory work, but it doesn't. Also, `` with `render=":#{layer2.clientId}"` should in theory work, but it doesn't. Both approaches works in both MyFaces/Mojarra when `` doesn't come into picture. So it's perhaps also a *bit* broken in MyFaces. – BalusC Oct 19 '11 at 15:38