Cross posted on community.wolfram.com
Question and requirements
Is it possible to HTTPRedirect
from a Cloud CDF via e.g. Button
action?
I need an interactive cloud cdf around it.
The action would not only redirect but evaluate arbitrary code prior to that.
If it matters the target page does not need to be any page but an arbitrary
CloudObject
is enough.No, I don't want to hide old stuff and show new to the user, I really need to redirect.
No, open in new tab does not count.
So it would work analogously to this form's submit button:
CloudDeploy[
FormFunction[{"go on and submit"}
, Module[{link}
, link = CloudPut[RandomReal[], Permissions -> "Public"]
; HTTPRedirect[link]
] &
]
, Permissions -> "Public"
]
Problems
Wasn't able to achieve that, here's why:
Form/ApiFunctions
whereHTTPRedirect
works well can't have interative CDFs embedded inside:CloudDeploy[ FormFunction[ { "this is ok" , ExportForm["this is not ok", "CloudCDFElement"] } , foo ] , Permissions -> "Public" ]
and I can't trigger
HTTPRedirect
from cloud CDF, nothing happens:CloudDeploy[ ExportForm[ Button["Submit", Print[1]; HTTPRedirect["http://www.wolfram.com"]], "CloudCDFElement" ], Permissions -> "Public" ]
Hyperlink
to look like a button. ASystemOpen
call works too, except it's viewed as a popup. Is that okay? $\endgroup$EmbeddedHTML
seems to only let you work with iframes and I can't access theStyleDefinitions
in the cloud so clearly they're baked in. $\endgroup$