object lookup in code sources

Andy Altepeter <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
I'm running into a really odd problem with using the new object lookup window 
in a code source.  First off, I notice Formulator doesn't have buttons (?), 
so I'm using a text field with name=document.  The TALES expression for this 
field looks like:

string:id='es_silva_document' onclick="reference.getReference(function(path, 
id, title) {document.getElementById('es_silva_document').value = path;}, 
'${request/model/aq_parent/absolute_url}',  'Silva Document', true);return 
true;"

So, this code source works in kupu when adding a fresh code source of this 
type.  When I click on the textfield, the object lookup window opens, I can 
select the object and 'place' the path into my textfield.

However, if I select an existing code source of this type, the onclick does 
not work.  When I click on the field, it only edits the text.

Has anyone experienced this before?  I troubleshooted a bit with venkman, and 
found a few curious things:

1) It appears the code to retrieve the code source form is called twice.
2) If I put a 'debugger;' at the beginning of     
this._continueStartExternalSourceUpdate, clicking continue twice (because it 
is called twice), the onclick does actually work.

Seems like some wierd timing issue going on, but I have no idea where to go 
from here.  The onclick works perfectly in the forms-based editor.

BTW, I'm using Silva-1.4.1 and kupu 1.3.2

Thanks for the help,
Andy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.