voyent
Messages posted by: agranados  XML
Profile for agranados -> Messages posted by agranados [7]
Author Message

philip_b wrote:
Hi David,

Sorry for the late reply on this. At this time it's not possible do node to node drag and drop within a tree. As you've noted, the drop targets inside the tree do not accept drag items. We also need to work in API support for tree model changes on these drag and drop events.

Thanks,
Philip 


I'm a bit surprised with this reply too. I've been having trouble with tree based drag/drop (see e.g. my post: http://www.icefaces.org/JForum/posts/list/1492.page) but it was "kinda" working. Has there been any change to the "not possible" answer with the more recent releases of IceFaces?
I could probably do something with an HTML table....consider this a request for ICEFaces to support resizable frames! :-)
Sorry I didn't reply earlier...I had turned on 'watch' and normally that sends an email when someone replies..

anyway, I see the problem in both IE 6.0 and Firefox 1.5.0.4 The image is from IE. It basically looks like the rendering image is not properly aligning the two sets of images. The problem is amplified for me because I was adding inline images to the tree node, the inlines are the colored (green) dots--in some cases these go away (on purpose) but the ghosted image doesn't change properly, this is seen in the bottom-most entry in the tree
I'm creating an application with multiple facets (using panelBorder), and want the user to be able to click on a "frame" of a window to resize it--just like one can resize the frame areas at http://java.sun.com/javaee/javaserverfaces/1.1/docs/api/index.html (the frames version). I've searched through the forums, as well as googled for various combinations of "jsf form frame resize drag", etc., with no luck. Any suggestions?
I'm trying to make two trees, and provide drag-and-drop functionality between tree elements both within one tree, and between the two trees. There are several little problems with the drag/drop functionality. If I try and use any drag option other than "dragGhost", the values set in dragValue and dropValue end up ok if I'm moving "up" the tree, but backwards if I move "down" the tree (my destination and source nodes in the tree end up swapped depending on which way I drag, up or down the tree. Also, the visible icon being dragged dissappears as soon as I drag the icon off of the original panel group (although the drag operation still completes).

This problem goes away if I use the "dragGhost" option, that is, my source and destination nodes are correct, and the dragged icon remains visible the entire time. However, a new problem arises. Both the text and the icon visible in the tree end up being displayed twice, and are slightly overlapping producing a "double vision" effect. I prefer the dragGhost option as it keeps the icon visible as I drag it around, and seems to solve my node inversion problem, but I have to get rid of the double images!!

The relevant JSF code is presented below--I have two of these trees implemented in separate JSP files, and populating two different panel groups on the main form. The JSF below is included into the main page using a jsp:directive.include Below the JSF code is the relevant code from the backing bean.

---JSF--code

<ice:form xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">

<ice:panelGrid styleClass="contentLayoutGridStyle" columns="1" border="0">

<ice:panelGroup styleClass="treeContainer" >
<ice:tree id="systemTree"
value="#{orchard.systemTree.model}"
var="systemItem"
hideRootNode="false"
hideNavigation="false"
imageDir="#{styleBean.imageDirectory}" >

<ice:treeNode>
<f:facet name="icon">
<ice:panelGroup style="display: inline" draggable="true" dropTarget="true"
dropListener="#{orchard.dropListener}"
dragOptions="dragGhost"
dragValue="#{systemItem.userObject.nodeId}"
dropValue="#{systemItem.userObject}"
dragMask="dragging,drag_cancel,hover_end,hover_start"
dropMask="dragging,drag_cancel,hover_start,hover_end"
immediate="true">
<h:graphicImage value="#{systemItem.userObject.icon}" />

<ice:commandLink
actionListener="#{systemItem.userObject.nodeClicked}">
<ice:outputText value="#{systemItem.userObject.text}" />
</ice:commandLink>
</ice:panelGroup>
</f:facet>
</ice:treeNode>
</ice:tree>
</ice:panelGroup>

<ice:panelGroup styleClass="treeNodeControlButtonsBorder" dropTarget="true">
<ice:panelGrid columns="2">
<h3><ice:outputText value="Drag Action" /></h3>
<h4><ice:outputText value="#{orchard.dragAction}" /></h4>
<h3><ice:outputText value="Destination Folder " /></h3>
<h4><ice:outputText value="#{orchard.destinationFolder}" /></h4>
<h3><ice:outputText value="Source Folder " /></h3>
<h4><ice:outputText value="#{orchard.sourceFolder}" /></h4>
<h3><ice:outputText value="Destination Object ID " /></h3>
<h4><ice:outputText value="#{orchard.destinationObjectId}" /></h4>
<h3><ice:outputText value="Source Object ID " /></h3>
<h4><ice:outputText value="#{orchard.sourceObjectId}" /></h4>
</ice:panelGrid>
</ice:panelGroup>

</ice:panelGrid>
</ice:form>

---java source from backing bean---

public void dropListener(DropEvent event)
{

destinationFolder = event.getTargetDropValue().toString();
dragValue = ((HtmlPanelGroup)event.getComponent()).getDragValue().toString();
dropValue = ((HtmlPanelGroup)event.getComponent()).getDropValue().toString();
sourceFolder = dragValue;

destinationObject = (SystemUserObject)event.getTargetDropValue();
destinationObjectId = destinationObject.getNodeId();

sourceObject = (SystemUserObject)((HtmlPanelGroup)event.getComponent()).getDropValue();
sourceObjectId = sourceObject.getNodeId();
sourceFolder = sourceObject.toString();
}
I've been successfully using ICE Faces beta (0.3.0 and 0.3.1 with Eclipse and JDK 5 deploying to JBoss 4.0.2. With the release of v1.0 of the community edition I updated the relevant jar files as before (e.g., same process as when I switched from 0.3.0 to 0.3.1) and am now getting the following exception:

javax.servlet.ServletException: Can't parse stream for /login.jspx com.icesoft.faces.component.ext.taglib.Util.isVisibleOnUserRole(Ljavax/faces/component/UIComponent;)Z

this is being caused by a NoSuchMethodError which I attributed to a classpath problem. I double checked my code, and as far as I can tell, I never make a call to "isVisibleOnUserRole", and the strange thing is, when I look at icefaces-comps.jar which contains com.icesoft.faces.component.ext.taglib.Util, there is no such method as "isVisibleOnUserRole". The closest thing is either "isEnabledOnUserRole" or "isRenderedOnUserRole".

I'm assuming something changed between 0.3.1 and 1.0, which is causing me this problem? Help anyone?
I should add that I went from 0.3.1 alpha to 1.0. I don't know if there were a couple more alpha releases in between that had additional changes. I've been bitten by that before, where I skipped a release and it was the release notes for the one I skipped that had the solution to my problem.
 
Profile for agranados -> Messages posted by agranados [7]
Go to:   
Powered by JForum 2.1.7ice © JForum Team