[daisy] How to set a value by javascript within a selection list?
Bruno Dumon
bruno at outerthought.org
Mon Apr 14 16:12:49 CEST 2008
Makes me think of it: the branch and language should be -1. The special
value -1 denotes a branch and language which are not set, meaning that
they will be relative to document containing the link field. The entries
in the selection lists are also such that the branch and language are -1
if they are the same as those of the document.
On Mon, 2008-04-14 at 15:50 +0200, Karel Vervaeke wrote:
> IIRC, you need to set it as a string: 'daisy:id at branch:language',
> but then again I could be wrong, I thought the approach you were using
> should also work (Sorry, I don't have time to investigate right now -
> but please let me know if the string approach works).
>
> Regards,
> Karel
>
> On Mon, 2008-04-14 at 10:09 +0200, Sven Reher wrote:
> > 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
> >
--
Bruno Dumon http://outerthought.org/
Outerthought http://www.daisycms.org/
bruno at outerthought.org http://www.kauriproject.org/
More information about the daisy
mailing list