You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Vladimir Nišević <vn...@gmail.com> on 2014/12/04 14:54:04 UTC

Wicket viewer - Clob/Blob as return value of an domain service action, download file...

Hi there, I'm trying to implement an action on Domain Service (callable
form menu) with an Clob return value

e.g.

String content = "HiThere";
return new org.apache.isis.applib.value.Clob("addresses.txt", new
MimeType("text", "plain"), content.toCharArray());


Would expect to get an "Save As" dialog to store a file.

Would that make sense?

At the moment I get in wicket (1.7.0)

Stack trace:

   -
   org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException
   - Behavior rejected interface invocation. Component: [AjaxButton
   [Component id = cancelButton]] Behavior:
   org.apache.wicket.ajax.markup.html.form.AjaxButton$1@56ced81f Listener:
   [RequestListenerInterface name=IBehaviorListener, method=public abstract
   void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
   -
   org.apache.wicket.RequestListenerInterface#invoke(RequestListenerInterface.java:237)
   -
   org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#invokeListener(ListenerInterfaceRequestHandler.java:250)
   -
   org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#respond(ListenerInterfaceRequestHandler.java:236)


Regards,Vladimir

Re: Wicket viewer - Clob/Blob as return value of an domain service action, download file...

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

This should work.
https://github.com/isisaddons/isis-module-docx does the same. It uses Blob.

Could you please paste the complete exception ? Is there caused by/root
exception below these lines ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Dec 4, 2014 at 2:54 PM, Vladimir Nišević <vn...@gmail.com> wrote:

> Hi there, I'm trying to implement an action on Domain Service (callable
> form menu) with an Clob return value
>
> e.g.
>
> String content = "HiThere";
> return new org.apache.isis.applib.value.Clob("addresses.txt", new
> MimeType("text", "plain"), content.toCharArray());
>
>
> Would expect to get an "Save As" dialog to store a file.
>
> Would that make sense?
>
> At the moment I get in wicket (1.7.0)
>
> Stack trace:
>
>    -
>
>  org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException
>    - Behavior rejected interface invocation. Component: [AjaxButton
>    [Component id = cancelButton]] Behavior:
>    org.apache.wicket.ajax.markup.html.form.AjaxButton$1@56ced81f Listener:
>    [RequestListenerInterface name=IBehaviorListener, method=public abstract
>    void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
>    -
>
>  org.apache.wicket.RequestListenerInterface#invoke(RequestListenerInterface.java:237)
>    -
>
>  org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#invokeListener(ListenerInterfaceRequestHandler.java:250)
>    -
>
>  org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler#respond(ListenerInterfaceRequestHandler.java:236)
>
>
> Regards,Vladimir
>