Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

onload function required for multiple tiles in a single form

 
eric he
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have multiple tiles, each of them requires enable/disable some controls when the form is initially loaded, they are used together inside a single form of a generic layout jsp, which I can't modify, anybody knows how to make it work?

Thanks in advance.

Eric
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just put the enable/disable code in a <script></script> tag set at the bottom of your HTML in each page. I'm not talking about writing a function, I'm talking about just writing lines of JavaScript code that will run when the page is rendered. This will have the same effect as having it executed by the body's onload event.
 
eric he
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrill, your suggestion worked, it seems have the same effect as putting a function call inside form.onload.

Eric
 
eric he
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
more interesting question would be, what if I want to do something on form.reset, suppose I know the form.onreset for the layout is empty, and I have resetTile1, resetTile2 on two different tiles, is there any javascript solution to do that without changing the layout? this should be a common tiles question.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic