Message Boards Message Boards

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

Help deploying button functionality to Wolfram Cloud

I'm having trouble getting buttons to work when deployed to the cloud and would appreciate any advice. This simple example works as anticipated when run in the local notebook, it simply generates a 3-column grid and pressing the button in the 3rd column will print the associated values for the first two columns in that row:

myGrid := Module[{t,f},
    t = Table[{x, RandomWord[], RandomInteger[10]}, {x, 1, 10}];
    f[y_] := Print@t[[y]][[2 ;; 3]];
    Grid[{#[[2]], #[[3]], Button["Select", f[#[[1]]]]} & /@ t, 
    Frame -> All]
]

However, when deployed to the cloud using:

CloudDeploy[myGrid]

the expected grid gets generated but the buttons fail to print the rows. Perhaps I'm not deploying this correctly and would appreciate any advice. Thanks!

POSTED BY: John Cromwell
2 Replies
Posted 1 year ago

Try using Dynamic, like this:

CloudDeploy[Dynamic@myGrid]
POSTED BY: Hans Milton

Many thanks! Greatly appreciated!

POSTED BY: John Cromwell
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