So it must be initialized every time you replace... probably. Attach
something like this onto your replace component:

public class GenericDomReadyTailJavaScriptBehavior extends AbstractBehavior {
  private final String javaScript;

  /**
   * @param javaScript
   */
  public GenericDomReadyTailJavaScriptBehavior(String javaScript) {
    this.javaScript = javaScript;
  }

  /**
   * @see 
org.apache.wicket.behavior.AbstractBehavior#onRendered(org.apache.wicket.Component)
   */
  @Override
  public void onRendered(Component component) {
    super.onRendered(component);
    writeJavaScript(component);
  }

  /**
   * @param component
   */
  protected void writeJavaScript(Component component) {
    JavascriptUtils.writeJavascriptUrl(component.getResponse(),
RequestCycle.get().urlFor(WicketEventReference.INSTANCE).toString());
    {
      JavascriptUtils.writeJavascript(component.getResponse(),
"Wicket.Event.add(" + "window" +
          ", \"" + "domready" + "\", function(event) { " +
getJavaScript() + ";});");
    }
  }

  /**
   * @return the javaScript
   */
  public String getJavaScript() {
    return javaScript;
  }
}


2010/5/19 Ivoneta <ietaraz...@gmail.com>:
>
> In the web Page head. Is the only place where I initialize the js.
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/replace-panel-problems-tp2221878p2221908.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to