Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.10.0
-
None
Description
For example:
public Object downloadThis() { return new Clob(...); }
there are two possible workarounds; either:
a) return Clob (or Blob) instead of Object
public Clob downloadThis() { return new Clob(...); }
b) make the action take one or more args (not be a no-arg):
public Object downloadThis(String filename) { return new Clob(...); }
~~~
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:
ActionResultResponse resultResponse = ActionResultResponseType.determineAndInterpretResult(this.getActionModel(), target, resultAdapter); resultResponse.getHandlingStrategy().handleResults(this, resultResponse);
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.
Attachments
Issue Links
- is related to
-
CAUSEWAY-2538 Action results of type LocalResourcePath should be able to replace the current page.
- Closed