Search code examples
drag-and-droprichfaces

rich:dragSupport inside an ui:repeat


I'm having issues with rich:dragSupport inside an ui:repeat. The component is displayed correctly but the drag action isn't called.

This code works:

<a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
    <rich:dragSupport dragIndicator=":indicator" dragType="type" dragValue="CALENDAR" reRender="editPanel">
        <rich:dndParam name="label" value="Calendar" />
    </rich:dragSupport>
    <h:outputText value="Calendar"></h:outputText>
</a4j:outputPanel>

But this does not:

<ui:repeat value="#{formBuilderManagerBean.inputElements}" var="input">
    <a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
        <rich:dragSupport dragIndicator=":indicator" dragType="type" dragValue="#{input.componentId}" reRender="editPanel">
            <rich:dndParam name="label" value="#{msg[input.name]}" />
        </rich:dragSupport>
        <h:outputText value="#{msg[input.name]}"/>
    </a4j:outputPanel>
</ui:repeat>

The input object's getComponentId() method doesn't even get called! HALP!


Solution

  • Apparently using <c:forEach> instead of <ui:repeat> works.