Message Boards Message Boards

1
|
4281 Views
|
0 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Cloud CDF and HTTPRedirect

Posted 8 years ago

Cross posted on mathematica.stackexchange.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 should do.

  • 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 where HTTPRedirect works well can't have interative CDFs embedded inside:

     CloudDeploy[
         FormFunction[
             { "this is ok"
             , ExportForm["this is not ok", "CloudCDFElement"]
             }
           , foo
         ]
       , Permissions -> "Public"
     ]
    

> enter image description here

  • 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"
         ]
    

> enter image description here

POSTED BY: Kuba Podkalicki
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract