DBTreeView Bean

Hi
I have been having a first play with Servoy’s DBTreeView having previously used Dr Maison’s version. The reason for the change is to allow web clients to see the bean which does not see possible with Dr Maison’s.

What I need to happen is a facility where the user drags a record over the tree and as they drag over each node of the tree it will allow them to drop into the node OR open the node. This certainly works with Dr Maisons bean, however the process is different for Servoys version. SO two questions:

  1. Is it possible to drop content from one form into the node of a tree on another form

  2. Is there any one who has either done this and can share how OR any instructions how because the various docs and examples don’t cover this use case

Many thanks in advance
Gordon

hi Gordon,

the dbtreeview bean that comes with Servoy 6, does have support
for drag&drop, see its setOnDrag, setOnDragEnd, setOnDragOver, setOnDrop methods.
Those are working in the similar way like the same methods from the forms.
I will do a sample, asap, and will post on the forum

regards,
Gabi

Hi Gabi

Thanks for the reply, not sure its what I wanted to hear but will save be a lot of time trying to track down the problem!!

I have got the tree to do the same as the example drag_n_drop_sample i.e. drag records to the form and do stuff, so we will have to come up with a work around.

On the subject of the drag_n_drop_sample from Servoy example 5 does not work - I am not sure where to report this but its a critical feature that I need i.e. Drag an item from the desktop to a servoy solution and then deal with the result. Current requirement mentioned a week ago was drag image file i.e. scan from desktop to Servoy and stream this to the server. So far the only way I have been able to make this work was with Patricks bean in V 5.2

Cheers
Gordon

Regarding dropping files: have you tried what I posted here: viewtopic.php?f=2&t=16817&p=90850#p90850

Hi Patrick
I have just changed over to 6, took your advice on 5 and it works, however need for various reasons to move to 6, will try this again with your post info - first try failed, but I have now done a lot more with 6 so will give it another go

Best
Gordon

Huh? My advice in the link only works with Servoy 6! In Servoy 5 you cannot drop files without a bean!

Yep - I understood that I will have give it a go again NOW and let you know !!
Thanks …

Hi

Firstly can I thank Patrick and Gabi for their input and to Patrick for testing the demo solution I posted.

The issue is in fact a Servoy bug. On the Mac you can not drag a file onto Servoy and have Servoy 6 trigger a onDrop event. However on Windows this is not a problem, so the solution posted by Patrick does work perfectly on Windows.

I will post this on the Servoy bug list and hopefully it can be fixed in the future issue. Also needless to say I suspect the Demo drag and drop solution example 5 will work seamlessly on Windows as expected, Macs will have to wait !

Cheers

I noticed some other little flaws with this:

  • if the onDragOver method returns false, you can still drop which is not expected, is it?
  • the onDragOver method seems to be fired only once (the first time you drop files)
  • if onDragOver returns false, then yes, onDrop should not be called - you may
    create a case for this;
  • onDragOver is called when a drag enters the element - if this is not like this, then
    it is an issue;

patrick:
I noticed some other little flaws with this:

  • if the onDragOver method returns false, you can still drop which is not expected, is it?
  • the onDragOver method seems to be fired only once (the first time you drop files)

Gabi

This us exactly the problem and I posted a bug issue yesterday, I don’t have the Id to hand. Attached to the bug report is a solution which works on pc with Patricks observations and fails on the Mac.

Cheers