I am processing a set of data using Manipulate
, as I need some user input as well and the whole code must be delivered as .cdf .
The set of data should be imported from an Excel file which is selected by the user (this is made through SystemDialogInput
).
How can I put everything "on hold" in the Manipulate
until I load the external set of data? The data is loaded in a variable, which is of course empty in the first moment and this produce only error messages...
-
$\begingroup$ Does the customer have PlayerPro, Mathematica, or do you possibly have Enterprise Mathematica? If no then the cdf is not capable of importing data. $\endgroup$– KubaCommented Jan 15, 2016 at 12:51
-
$\begingroup$ Enterprise Mathematica is planed to be aquired and the cdf should be embeded in web site. $\endgroup$– ConradCommented Jan 15, 2016 at 13:12
-
5$\begingroup$ I think the trick is to use a Button with Method->"Queued" to open the SystemDialogInput. You will find detailed examples and explanations on this site when searching for Queued... $\endgroup$– Albert ReteyCommented Jan 15, 2016 at 14:23
1 Answer
I used two solutions for this problem in the past which are straight forward. The first one is that you initialize your data with an empty data structure that does not produce an error in your dynamic code.
The other, and maybe better alternative is to use a helper variable isInitialized
which puts your visualisation on hold until you have loaded a valid data set.
Remember the tip of Albert that you should consider using Method -> "Queued"
in your load button as it might be the case that loading an Excel file takes longer and the Manipulate
interrupts this call otherwise.