• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Update select list from a callee page

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

Here is code for dynamically adding an item to a select list. It works well.

The problem is if the "Add" action is fired from a callee page, there is an error

Object doesn't support this property or method

in the line:

Does anyone know why?

I checked theSelect and it is a select object as expected. Here is the code:


Thanks,
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
If you are doing this from a popup window then i think you need to call the form by prepending window.opener.
for example
window.opener.theForm.theList.........
As it is the new page it doesnt have the form of the calling page.
I think this should be the problem.
If anything else then do post a clarification.
 
Sophie Cameron
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Niki,

Thanks for your response.

Actually the form in the calling page is referenced by in the , here is the object of the calling page. No problem with it.

I believe it is because of some other issue.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is how I would do it:
Main page:


The modal window (myDialogWin.htm):


Hope that helps you out
Eric
 
Sophie Cameron
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much, Eric. It really helped me out.

It seems that the problem is related to parameter passing issues. Objects are passed by reference but their attributes are by value.
 
reply
    Bookmark Topic Watch Topic
  • New Topic