You seem to be mixing together client-side activity
('mouse selection') and server-side activity ('query the zodb'?). You will need to separate these two activities: use
_javascript_ for the client side and build a normal form-based request which is
then submitted to a zope method (dtml/script/external method) which processes
the fields from the form request and returns some object(s)? from the
zodb.