Hello all,
 
What I'm trying to do is have a Label that I can double click to open a popup window.  I don't really care if it's Ajax or static _javascript_, I just need it to work.  However, Ajax seemed easiest so I've added the following Ajax behavior to a Label:
 
<<
 private static class DoubleClickEditorAjaxBehavior extends AjaxEventBehavior
 {
  // Constants
  private static final long serialVersionUID = 460292942456978352L;
  
  // Member Variables
  private String url;
 
  /**
   * Constructor.
   */
  public DoubleClickEditorAjaxBehavior(String url)
  {
   super("onDblClick");
   
   this.url = "">  }
 
  /**
   * Opens the
[EMAIL PROTECTED] SnippetEditorPopupPage}.
   *
   * @see wicket.ajax.AjaxEventBehavior#onEvent(wicket.ajax.AjaxRequestTarget)
   */
  @Override
  protected void onEvent(AjaxRequestTarget target)
  {
   PopupSettings popupSettings = new PopupSettings(PageMap
     .forName("contentEditorPageMap")).setHeight(
     SnippetEditorPopupPage.WINDOWS_HEIGHT).setWidth(
     SnippetEditorPopupPage.WINDOW_WIDTH);
   popupSettings.setTarget("'" + url + "'");
   
   if(target != null)
    target.appendJavascript(popupSettings.getPopupJavaScript());
  }
 }

>>
 
It doesn't seem to do anything, though the Ajax debug window shows the following every time I double click:
<<
INFO:
INFO: Initiating Ajax GET request on /doh?wicket:interface=:0:dynamicPageContent::IBehaviorListener&wicket:behaviorId=3&random=0.5027223472182086
INFO: Invoking pre-call handler(s)...
INFO: Received ajax response (354 characters)
INFO:
<?xml version="1.0" encoding="UTF-8"?><ajax-response><evaluate><![CDATA[window.open('/doh?wicket:bookmarkablePage=:simplepersistence.feature.dynamicPages.SnippetEditorPopupPage&0=karl&1=1', 'contentEditorPageMap', 'scrollbars=no,location=no,menuBar=no,resizable=no,status=no,toolbar=no,width=750,height=550');  return false;]]></evaluate></ajax-response>
INFO: Response parsed. Now invoking steps...
ERROR: Exception evaluating _javascript_: SyntaxError: invalid return
INFO: Response processed successfully.
INFO: Invoking post-call handler(s)...
>>
 
Can anyone point out what I might be doing wrong or a better way to go about this?
 
Thanks,
Karl
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to