Select Update Pb

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • HENNINOT FRÉDÉRIC

    Select Update Pb

    Hi,
    I've a pb only with IE!
    A popup windows must be update an opener select form!!

    In my popup i execute this :
    addOption = new Option();
    addOption.text = 'Aude';
    addOption.value = 12;
    newIndex = top.opener.docu ment.test.dept. options.length;
    opener.document .test.dept.opti ons[newIndex] = addOption;

    It's very good on Mozilla browser! but not in IE!!
    On IE i've an error : 'Le serveur a généré une exception'

    Have you some solution?
    thanks!
    Fred


  • Richard Cornford

    #2
    Re: Select Update Pb

    HENNINOT FRÉDÉRIC wrote:
    <snip>[color=blue]
    > A popup windows must be update an opener select form!![/color]

    Must implies the absence of alternatives, there probably are
    alternatives.
    [color=blue]
    > In my popup i execute this :
    > addOption = new Option();[/color]
    <snip>[color=blue]
    > newIndex = top.opener.docu ment.test.dept. options.length;
    > opener.document .test.dept.opti ons[newIndex] = addOption;[/color]
    <snip>

    When you use - new Option() - in the pop-up it is the Option constructor
    local to the pop-up that is used, and the resulting object is located in
    memory belonging to the pop-up. Inserting that object into a document in
    another window either will not be allowed, will tie-up the memory used
    by the pop-up after it is closed, or will require that the browser
    recognise what is going on an clone the original Option into a new one
    local to the original window. IE takes the first choice.

    You could try using the Option constructor form the original window as -
    new opener.Option() - or you could make a function in the opener that
    creates and adds the new Options locally, and call that from the pop-up
    passing the string values needed for - text - and - value - as arguments
    to that function. (the function in the opener option is the one I would
    go with)

    In the end, though, you are going to find that pop-ups are not the easy
    answer for UI design that they first appear to be.

    Richard.


    Comment

    Working...