AbstractDefaultAjaxBehavior - Could not find root ajax-response element

2010-08-19 Thread Thierry Peng

Hello

I have a resourcelink where I need to add an ajaxcallback to recalculate and 
update the current panel.
I added an AbstractDefaultAjaxBehavior to that link with the callback, but the 
respond method was never invoked.
In the wicket ajax debug i saw the following input: 



*INFO: *Using XMLHttpRequest transport

*INFO: *

*INFO: *Initiating Ajax GET request on 
?wicket:interface=:0:middle:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=truefoo=barrandom=0.6376184095942993

*INFO: *Invoking pre-call handler(s)...

*INFO: *Received ajax response (0 characters)

*INFO: *

*ERROR: *Wicket.Ajax.Call.failure: Error while parsing response: Could not find root 
ajax-response element

*INFO: *Invoking post-call handler(s)...

*INFO: *Invoking failure handler(s)...

behavior:

final AbstractDefaultAjaxBehavior behave =new AbstractDefaultAjaxBehavior()
   {
 @Override
 protected void respond(AjaxRequestTarget arg0)
 {
   log.debug(respond called);
   repaint();
   arg0.addComponent(self);
 }
 @Override
 protected void onComponentTag(ComponentTag tag)
 {
   super.onComponentTag(tag);
   log.debug(on componenttag called);
   String javascript = wicketAjaxGet(' + getCallbackUrl()
 + foo=bar', function() { }, function() { });;
   tag.put(onClick, javascript);
 }
   };

resourcelink:
add(link = new ResourceLinkVoid(link, new DynamicWebResource()
   {
 @Override
 protected void setHeaders(WebResponse response)
 {
   super.setHeaders(response);
   response.setAttachmentHeader(auszug.zip);
 }

 @Override
 protected ResourceState getResourceState()
 {
   return new ResourceState()
   {
 byte[] data;

 @Override
 public byte[] getData()
 {
   if (data == null)
   {
 try
 {
   data = builderservice.getDataAsZip(rawdata);
   log.debug(length of data: +data.length);
 } catch (SystemException e)
 {
   log.fatal(systemexception occured, e);
 }
   }
   return data;
 }
 @Override
 public String getContentType()
 {
   return application/zip;
 }
   };
 }
   })
   );
   link.add(new Label(label, new 
ResourceModel(middle.mailbox.download.all)));
   link.add(behave);

html (as it appears in the browser):

/form
a id=link5e href=?wicket:interface=:0:middle:link::IResourceListener:: 
view-source:http://localhost:8080/postfach/?wicket:interface=:0:middle:link::IResourceListener:: 
onclick=wicketAjaxGet('?wicket:interface=:0:middle:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true', function() { 
}, function() { });spanAlle Dokumente herunterladen/span/a
/div/td
td/td/tr
/table
/td/tr/table/tdtdnbsp;/td/tr/table
/body
/html

Any ideas to how to solve this problem?

greetings


thierry


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



Re: AbstractDefaultAjaxBehavior - Could not find root ajax-response element

2010-08-19 Thread Thierry Peng
Some additional info;rmation; this error occurs with the mozilla firefox 
3.6.8 while the same code works with the internet explorer 8. Now I'm 
really confused...


I works also with chrome v5 and opera 10.10

Thierry Peng schrieb:

Hello

I have a resourcelink where I need to add an ajaxcallback to 
recalculate and update the current panel.
I added an AbstractDefaultAjaxBehavior to that link with the callback, 
but the respond method was never invoked.

In the wicket ajax debug i saw the following input:

*INFO: *Using XMLHttpRequest transport

*INFO: *

*INFO: *Initiating Ajax GET request on 
?wicket:interface=:0:middle:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=truefoo=barrandom=0.6376184095942993 



*INFO: *Invoking pre-call handler(s)...

*INFO: *Received ajax response (0 characters)

*INFO: *

*ERROR: *Wicket.Ajax.Call.failure: Error while parsing response: Could 
not find root ajax-response element


*INFO: *Invoking post-call handler(s)...

*INFO: *Invoking failure handler(s)...

behavior:

final AbstractDefaultAjaxBehavior behave =new 
AbstractDefaultAjaxBehavior()

   {
 @Override
 protected void respond(AjaxRequestTarget arg0)
 {
   log.debug(respond called);
   repaint();
   arg0.addComponent(self);
 }
 @Override
 protected void onComponentTag(ComponentTag tag)
 {
   super.onComponentTag(tag);
   log.debug(on componenttag called);
   String javascript = wicketAjaxGet(' + getCallbackUrl()
 + foo=bar', function() { }, function() { });;
   tag.put(onClick, javascript);
 }
   };

resourcelink:
add(link = new ResourceLinkVoid(link, new DynamicWebResource()
   {
 @Override
 protected void setHeaders(WebResponse response)
 {
   super.setHeaders(response);
   response.setAttachmentHeader(auszug.zip);
 }

 @Override
 protected ResourceState getResourceState()
 {
   return new ResourceState()
   {
 byte[] data;

 @Override
 public byte[] getData()
 {
   if (data == null)
   {
 try
 {
   data = builderservice.getDataAsZip(rawdata);
   log.debug(length of data: +data.length);
 } catch (SystemException e)
 {
   log.fatal(systemexception occured, e);
 }
   }
   return data;
 }
 @Override
 public String getContentType()
 {
   return application/zip;
 }
   };
 }
   })
   );
   link.add(new Label(label, new 
ResourceModel(middle.mailbox.download.all)));

   link.add(behave);

html (as it appears in the browser):

/form
a id=link5e 
href=?wicket:interface=:0:middle:link::IResourceListener:: 
view-source:http://localhost:8080/postfach/?wicket:interface=:0:middle:link::IResourceListener:: 
onclick=wicketAjaxGet('?wicket:interface=:0:middle:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true', 
function() { }, function() { });spanAlle Dokumente 
herunterladen/span/a

/div/td
td/td/tr
/table
/td/tr/table/tdtdnbsp;/td/tr/table
/body
/html

Any ideas to how to solve this problem?

greetings


thierry


-
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