You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eugene Prigarov <Eu...@enterra-inc.com> on 2003/11/10 13:23:53 UTC

java script problem

Hi!
I have a problem with body component. I want to set java script dynamically in action handler something like that:
 
public abstract class EditFormContainer extends BaseComponent
 
...
 
public void formSubmit(IRequestCycle cycle)
{
       Body body=Body.get (cycle);
       Body. body.addInitializationScript( "window.opener.location.refresh();" );
}
 
...
 
But nothing happened except NullPointerException, because the body == null.
What's wrong here? And how may I add java script to page's body any other way?
Maybe  it is possible use @Conditional component for dynamically java script setting?
 
 
Regards, Eugene Prigarov
Enterra Inc. 
mailto:  <ma...@enterra-inc.com> Eugene.Prigarov@enterra-inc.com