Re: XF: Adding select1 items using JS
Rojek Piotr <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Allan Beaufour wrote:
> On Monday October 17 2005 18:36, Rojek Piotr wrote:
>
>>Allan Beaufour wrote:
>>
>>>Friday 14 October 2005 15:30 skrev Rojek Piotr:
>>>
>>>>how can i add new item to my select1 element using JavaScript??
>>>>code example or website would be appreciated
>>>
>>>Why does it have to be through JavaScript?
>>>
>>>If the <select1> is using an <itemset>, you can use <insert> and
>>><setvalue> to add to it.
>>
>>My situation is:
>>I have one window that opens second. And this second does some
>>operations and then it must add some items to select1 which is placed in
>>the first.
>
>
> Argh. Subforms/multi-window is only on the drawing board in XForms :( We have
> <message>, but it only allows for <output> in its content, so that's no help.
>
>
>>That is why I would prefer JS.
>
>
> I wish I could give you something better, but this should work though:
> var mod = document.getElementById('modelid');
> var inst = mod.getInstanceDocument('instanceid');
> var parent = inst.getElementById/Tagname/whatever-gets-you-the-nodeset-target;
> var newtag = document.createElement("newtag");
> newtag.appendChild(document.createTextNode("test value"));
> parent.appendChild(newtag);
> mod.rebuild();
> mod.recalculate();
> mod.revalidate();
> mod.refresh();
> (quicly written, so I might have 100 parse errors, and the likes...)
>
>
>>Maybe I am missing sth because I am new in XF so please show me the path…
>
>
> I'll try, that's all I can promise :)
>
Thanks it worked and sorry for late answer but i was a bit busy.