Drag and Drop ProblemHi
ben27 Oct 23, 2008 10:39 AMHi everyone,
I have the following Problem:
I try to implement a simple Drag and Drop scenario, but the dragValue which I try to catch in a bean method is always null.
Configuration:
Richfaces 3.1.4. GA
Seam 2.0.2 SP1
JBoss AS 4.2
My JSF code:
<ui:define name="body">
<h:form id="dragDropForm">
<h:panelGrid columns="4">
<h:outputText value="No Structures Found"
rendered="#{chemAxonList.searched and chemAxonList.numberOfResults==0}"/>
<rich:panel id="resultpanel" rendered="#{chemAxonList.numberOfResults>0}">
<f:facet name="header">
<h:outputText value="Chemical Structures"></h:outputText>
</f:facet>
<rich:dataTable value="#{chemAxonList.resultList}" var="cs">
<rich:column id="col1">
<f:facet name="header">
Formula
</f:facet>
<a4j:outputPanel style="width:100px;border:1px solid gray;padding:2px" layout="block">
<rich:dragSupport dragIndicator=":indicator" dragType="PubChem" dragValue="#{cs}">
<rich:dndParam type="drag" name="label" value="#{cs.cdFormula}" />
</rich:dragSupport>
<h:outputText value="#{cs.cdFormula}"></h:outputText>
</a4j:outputPanel>
</rich:column>
<rich:column id="col2">
<f:facet name="header">
Traditional Name
</f:facet>
<h:outputText value="#{cs.pubchemIupacTraditionalName}" />
</rich:column>
<rich:column id="col3">
<f:facet name="header">
Details
</f:facet>
<s:link view="/detailsPage.xhtml" value="Select" id="pubChem">
<f:param name="pubChemCdId" value="#{cs.cdId}"/>
</s:link>
<!-- <a4j:commandLink id="showItem" oncomplete="Richfaces.showModalPanel('resultVisuPanel',{width:550, top:200});" reRender="testDIV">
show Details
</a4j:commandLink> -->
</rich:column>
</rich:dataTable>
</rich:panel>
<rich:panel styleClass="dropTargetPanel">
<f:facet name="header">
<h:outputText value="TEST" />
</f:facet>
<rich:dropSupport id="Droppanel" acceptedTypes="PubChem" dropValue="TEST" dropListener="#{personalFolder.processDrop}"/>
</rich:panel>
</h:panelGrid>
</h:form>
</ui:define>
The method in the Java Bean:
@Scope(ScopeType.SESSION)
@Name("personalFolder")
public class PersonalFolder implements DropListener {
...
public void processDrop(DropEvent dropEvent) {
System.out.println("DRAG and DROP ");
System.out.println("Drop Value " + dropEvent.getDropValue());
System.out.println("Drag Value " + dropEvent.getDragValue());
}
}
So, as I said, the problem is that the DropValue is null!?
Somebody out there who can help me?
Regards,
Ben