[daisy] How to set a value by javascript within a selection list?

Sven Reher sven.reher at kontextwork.de
Mon Apr 14 10:09:13 CEST 2008


Hello,

I want to create a new document with javascript. This document has got  
a 'query based selection list for link-type field', which I want to set.

Code in the javascript to set the selection list field:
    var key = new org.outerj.daisy.repository.VariantKey(docID,1,1);
    newDoc.setField('pw_LIThese', key );

The 'docID' has got the value of the document id where i click on the  
link to create a new document. This is working.
But when the editor is open, the 'pw_LIThese' selection field is not  
set. So I have to select the value by hand to save the document,  
because this is a required field. My idea is that this value will be  
set by javascript in the creating of the document. When i cancel and  
save with javascript before - the value is set correct. I reopen the  
document and the field doen't get the correct value in the selection  
list.

What i have to do to set a value for a selection list by javascript,  
so that the value is correct selected?

Thanks a lot
Sven




More information about the daisy mailing list