tags:

views:

25

answers:

2

Hi I am trying to implement drop feature of a4j with JSF Datatable. I have a datatable and I want to drop components into that data table. How do i do it.

The code for dropping it in a tree works fine:

Here's is the code of dropping it to the tree, but when i try to drop the same into a data table it doesn't work.

                        <rich:treeNodesAdaptor id="packageNodeAdaptor" nodes="#{target.packages}" var="package">

                            <rich:treeNode id="package" icon="/img/icons/Package_icon.png"
                                iconLeaf="/img/icons/Package_empty_icon.png" ajaxSingle="false"
                                acceptedTypes="dbObject">

                                <rich:dndParam name="label" value="Add to #{package.name}" />
                                <a4j:support event="ondrop"
                                    action="doAddDBObjectToPackage"
                                    reRender="targetsMaster,sourcesDetailPanel" status="waitStatus" >
                                    <f:setPropertyActionListener value="#{package}"
                                        target="#{workspace.selectedPackage}" />
                                </a4j:support><a4j:commandLink
                                    value="#{package.name}" id="commandLink#{package.name}" reRender="targetsDetailPanel">
                                    <f:setPropertyActionListener value="#{package}"
                                        target="#{workspace.selection}" />
                                </a4j:commandLink>

                            </rich:treeNode>
</rich:treeNodesAdaptor>

When I try to put the code in h:dataTable it doesnt work.

Here is the datatable part of it:

<rich:dndParam name="label" value="Add to #{package.name}" />

                            <a4j:support event="ondrop"
                                action="doAddDBObjectToPackage"
                                reRender="componentDetailInfoTab,sourcesDetailPanel" status="waitStatus" >
                                <f:setPropertyActionListener value="#{package}"
                                    target="#{workspace.selectedPackage}" />
                            </a4j:support>
                    </rich:dataTable>

Can you guide me how to resolve it.

Thanks, Abdul

A: 

Some richfaces components, such as a4j:commandButton don't work correct with h:datatable.

I would try the rich:datatable instead of h:datatable to eliminate the possibility that this is your problem.

Markos Fragkakis
A: 

Placing the dropSupport code inside <rich:dataTable tag doesn't work. Placing the code just outside the <rich:dataTable tag, and under the same form works perfectly fine. The dropSupport code for the tree in my post, works well when placed inside a form where the datatable is defined.

Abdul