I am trying to access the values of a dynamic value outside function package. Within the function package, the function is defined under the Dynamic module option. There is an error with this. I cannot extract the value.
inputCreate[no_, user_values_] := (DynamicModule[{value = Table[0, {no}, {user_values}]},
(If[(no > 0),
({Table[(With[{i = i, j = j},
(Row[{Column[{MouseAppearance[
EventHandler[
Style["\[FilledUpTriangle]", Bold, Black, {15, 15},
ShowStringCharacters ->
False], {"MouseClicked" :> (value[[i, j]] =
value[[i, j]] + 1)}],
"LinkHand"],
MouseAppearance[
EventHandler[
Style["\[FilledDownTriangle]", Bold, Black, {15, 15},
ShowStringCharacters ->
False], {"MouseClicked" :> (If[(value[[i, j]] <=
0), (value[[i, j]] = 0), (value[[i, j]] =
value[[i, j]] - 1)])}],
"LinkHand"]},
Spacings -> 0, Alignment -> Center,
Background -> RGBColor[0.65, 0.65, 0.65]],
Dynamic[If[(value[[i, j]] === Null), (value[[i, j]] = 0)];
InputField[Dynamic[value[[i, j]]], Number,
ContinuousAction -> True, ImageSize -> {50, 20},
Alignment -> Center]]}])]),
{i, 1, no}, {j, 1, Length[Part[value, i]]}],
Dynamic[value = If[value === Null, 0, value]]})
])])
When I deploy in CDF, this function works but I am unable to extract the value of myInput that I need to write into another file. Also, in the CDF, when I delete the zero and add click the uparrow, the value keeps incrementing + NUll whereas everytime I want to reset it to zero when the user deletes the values within the InputField.
So, just to extract the values, I implemented the same function with Module. However, within module, the initial value is not set to zero even though I have explicitly initialized it within the module.
InputField
s don't work in CDFs. Also, you can't write to files in CDFs. See this documentation, section "Interactivity in .cdf Files". $\endgroup$InputField
s are supported here details for programmers and numericInputField
s indeed do work in the free CDF-Player... $\endgroup$