1
$\begingroup$

I have created a simple FormPage that asks for some user input, and should display a list of manipulates which are influenced by the given input. I use EmbedCode to display my results. The code I used is as follows:

fo:=FormObject["type"->"Number"]
x:=CloudDeploy[Column[{Manipulate[ListLinePlot[{{1,5},{2,u},{3,5}}],{u,0,5}],Manipulate[ListLinePlot[{{1,v},{2,5},{3,v}}],{v,0,5}]}],Permissions->"Public"];
form:= FormPage[fo,EmbedCode[x]&]
CloudDeploy[form,Permissions->"Public"]

(Note that this is not the actual code I would like to use, but this code demonstrates my problem in the easiest way I could quickly think of.)

The code above renders a wolfram code IFrame as expected, but inside the IFrame the Manipulate expressions remain unevaluated. This is the result:

Result of previous code

I have tried numerous ways around this, but found nothing.

Curiously when I change x from a Column of Manipulates to a single Manipulate my code does work. Also when I replace x in the previous EmbedCode with a Column of any other expression it also seems to work. For example:

fo:=FormObject["type"->"Number"]
f[a_]:=a+1
x:=CloudDeploy[Column[{f[1],f[2],f[3]}],Permissions->"Public"]
form:= FormPage[fo,EmbedCode[x]&]
CloudDeploy[form,Permissions->"Public"]

works just fine:

enter image description here

Lastly I found out that when I change the assignment for x from := to = in the first code block it also works, but this is of no use for me since I want to be able to recalculate x based on the value of the FormObject fo. I know the difference between the different kinds of assignment but I just do not understand why it is important here, and why EmbedCode seems to work as I would want it to for any expression except for a list of Manipulates.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.