[ 
https://issues.apache.org/jira/browse/ISIS-1264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17288353#comment-17288353
 ] 

ASF subversion and git services commented on ISIS-1264:
-------------------------------------------------------

Commit fe048cbdfd336842829117709ecf75de975d6e04 in isis's branch 
refs/heads/master from Andi Huber
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=fe048cb ]

ISIS-1264: No-arg actions returning Blob/Clob but whose return type is
simply java.lang.Object no longer require AjaxDeferredBehaviour

> 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
>            Assignee: Andi Huber
>            Priority: Minor
>             Fix For: 2.0.0-M5
>
>
> 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