• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problems with onClick events

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I am trying out this program where I create a button('create new button') ,on clicking this button a window is created and a table is displayed with 2 rows and 2 columns ,where each cell has a different color.On clicking any cell with a specific color the parent window gets colored by the same color.
I tried the folowing:
This creates a new window along with the table(when I click the button) but when I click on a particular cell no change occurs... Help..
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is the entire code..please help..
 
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ayan Biswas wrote:here is the entire code..please help..






use parent.window.document.bgColor
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Jagdeep Sharma I modified the code..

But stil I am stuck with the same problem.A table with each cell of different color in created but on clicking that cell no change occurs in the parent window...Am I doing the syntax part right??...with so many single and double quotes the code has become extremely clumsy...
 
Jagdeep Sharma
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ayan Biswas wrote:@Jagdeep Sharma I modified the code..

But stil I am stuck with the same problem.A table with each cell of different color in created but on clicking that cell no change occurs in the parent window...Am I doing the syntax part right??...with so many single and double quotes the code has become extremely clumsy...





Why are you generating table on onClick. You can do one thing just make another page with this table.
Then call that page from this page. I think this problem can be on dynamic event binding. I don't know i have to check.
 
Ayan Biswas
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Jagdeep Sharma If I do what you are saying then, when I click the 'create new window' button I will get another html page wiith the table not a window of specific size.Is that what you meant?
 
Jagdeep Sharma
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ayan Biswas wrote:@Jagdeep Sharma If I do what you are saying then, when I click the 'create new window' button I will get another html page wiith the table not a window of specific size.Is that what you meant?







Exactly
 
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic