[ 
https://issues.apache.org/jira/browse/ISIS-1264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Keir Haywood updated ISIS-1264:
--------------------------------------
      Component/s:     (was: Isis Core)
                   Isis Viewer Wicket
    Fix Version/s:     (was: 2.12.0)
          Summary: No-arg actions returning Blob/Clob but whose return type is 
simply java.lang.Object throw exception.  (was: No-arg actions that return Blob 
or Clob but whose return type is simply java.lang.Object throw an exception.)

> No-arg actions returning Blob/Clob but whose return type is simply 
> java.lang.Object throw exception.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-1264
>                 URL: https://issues.apache.org/jira/browse/ISIS-1264
>             Project: Isis
>          Issue Type: Improvement
>          Components: Isis Viewer Wicket
>    Affects Versions: 1.10.0
>            Reporter: Daniel Keir Haywood
>            Priority: Minor
>
> For example:
> {code}
> public Object downloadThis() {
>     return new Clob(...);
> }
> {code}
> there are two possible workarounds; either:
> a) return Clob (or Blob) instead of Object
> {code}
> public Clob downloadThis() {
>     return new Clob(...);
> }
> {code}
> b) make the action take one or more args (not be a no-arg):
> {code}
> public Object downloadThis(String filename) {
>     return new Clob(...);
> }
> {code}
> ~~~
> In more detail:
> The ActionLinkFactoryAbstract class has a utility method 
> determineDeferredBehaviour that figures out from the actionModel whether this 
> is an action with no args and returning either a Clob/Blob or a URL (that 
> also requires special handling).  It has to do so by looking at the action 
> signature, ie the compile-time return type.  If the action matches, we get 
> back an AjaxDeferredBehaviour callback handler, and this is what is used to 
> handle the ajax request if the action's link is subsequently clicked.
> If the action doesn't conform to this, then we just get a regular 
> AbstractAjaxDefaultBehaviour.
> Later on, though, when we invoke the action (ActionPanel), we use this code:
> {code}
>             ActionResultResponse resultResponse = 
> ActionResultResponseType.determineAndInterpretResult(this.getActionModel(), 
> target, resultAdapter);
>             resultResponse.getHandlingStrategy().handleResults(this, 
> resultResponse);
> {code}
> which inspects the returned object and figures out the right way to "return" 
> it.  In the case of a Blob/Clob the selecting handlingStrategy basically 
> assumes that an AjaxDeferredBehaviour has been set up.  If it wasn't, then 
> everything blows up.
> ~~~
> Don't know how to fix this.  Perhaps Martin has a solution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to