addOptions should create new items in same document as parent for multi-frame scenarios

Description

From mailing list:

-------------------------------------------------------------------------------- From: "Marcos Vinícius B. de Souza" marvin.java@gmail.com
Sent: den 3 juli 2007 19:43
To: users@dwr.dev.java.net
Subject: Re: [dwr-user] IE7 object doesn't support this method

Hi all.
I find the problem: new Option() (in the addAllOptions() function) creates a Option element in the current 'document', but I am working with popups.
The my popup refreshes the select element from the document from the opener window.
So, the solution is this:

var parentDocument = window.opener.document;
var selectProdutos = parentDocument.getElementById('selectProdutos');
dwr.util.removeAllOptions(selectProdutos); // or selectProdutos.options.length=0;
for( var i=0; i<lista.length ; i++ ) {
var opcao = parentDocument.createElement('option');
opcao.value = dwr.util._getValueFrom(lista[i], 'id');
opcao.text = dwr.util._getValueFrom(lista[i], 'nameUnidade');
selectProdutos.options[selectProdutos.options.length] = opcao;
}

The only one problem is that in the IE7, the screen freezes while the select is populated.
Somebody have some other solution or suggestion ?

thanks...

Marcos Vinícius
Sun Certified Professional (SCJA)

Activity

Show:
Mike Wilson
November 23, 2008, 5:46 PM

Fix implemented that uses the popup window's document for creating new elements.

Assignee

Mike Wilson

Reporter

Mike Wilson

Labels

None

Documentation Required

None

Components

Fix versions

Priority

Major
Configure