I am trying to use FormFunction[]
to input data in my notebook.
As it shows up when using FormFunction
in a notebook (no web deploy)
no default values are displayed (even if specified) only empty input fields although the defaults are returned correctly when accepting the Form.
Bug or feature ? Is there any option to enable the initial display of default values?
Meanwhile I came up with the following solution:
FormFunctionInit[l_, "Init" -> True] :=
FormFunction[FormObject[l][Cases[l, (a_ -> b_ -> c_) :> (a -> c)]]]
FormFunctionInit[l_, ___] :=
FormFunction[FormObject[l][]]
form = FormFunctionInit[
{
"x1" -> "Number" -> 1,
"x2" -> "Number" -> 2,
"x3" -> "Number",
"x4" -> "Number" -> 4
}, "Init" -> True
];
input = form[] // Normal
out[[3]]= {x1->1, x2->2, x3->55, x4->4}
Any suggestions for improvement avoiding my custom code?