Search code examples
javajsfrichfaces

Drag and drop on outputText


I'm traying to make a draggable, I'm using richfaces 3.3 and this is my code :

<h:dataTable id="phptable" value="#{olapBackingBean.containerCube}" var="fm">
    <h:column>
       <h:outputText value="#{fm.name}">
    <rich:dragSupport dragIndicator=":indicator" dragType="Ok"
        dragValue="#{fm}">
       <rich:dndParam name="label" value="#{fm.name}" />
    </rich:dragSupport>
   </h:outputText>

</h:column>
</h:dataTable>

It doesn't work the column row are not draggable, I have no error.


Solution

  • Text is not a good thing for dragging. Instead wrap the text in an <a4j:outputPanel> and drag that:

    <h:column>
        <a4j:outputPanel>
            <h:outputText value="#{fm.name}" />
            <rich:dragSupport dragIndicator=":indicator" dragType="Ok"
                    dragValue="#{fm}">
                <rich:dndParam name="label" value="#{fm.name}" />
            </rich:dragSupport>
        </a4j:outputPanel>
    </h:column>