I need return the body of a zone and streamresponse.
I want to update a zone and returns a file.
The event in java will be like this:
Object[] onActionFromGenerar() throws InstanceNotFoundException{
/**
* Code
*
*/
try(InputStream input = new ByteArrayInputStream(cuaderno.getFichero())){
return new Object[] {new AttachmentStreamResponse(input,"Transferencias"), tableZone.getBody()};
}catch (IOException x){
System.err.format("IOException: %s%n", x);
return new Object[] { Index.class } ;
}
}
but return a error. Can only return tableZone.getBody();
How can I do?
You can't return both from a single action.
You'll need two actions.
JavaScriptSupport.addScript(...)
to load the second action when the zone updates on the client (eg setwindow.location.location.href
)StreamResponse
.