problem with default value
FormPage[{namespec -> type -> default, ...}, func ]usesdefaultas the default for the field specified bynamespec.CloudDeploy[#, Permissions -> "Public"] & @ FormPage[ "country" -> "Country" -> "CH" , GeoGraphics[#country] & ]I see Berlin, certainly not Switzerland. But ok, one can say it is a default value, not the initial one. Sure, but Berlin map stays there if you submit an empty field.
FormFunctiondocumentation allows type to be a string, here"Country", but let's use association form:<|"Interpreter" -> "Country".Still Berlin.
Full syntax with an initial value seems to work fine:
fullFormPage = FormPage[ "country" -> <|"Interpreter" -> "Country", "Input" -> "CH"|> -> "CH" , GeoGraphics[#country] & ]problem with typesetting
InputForm /@ { fullFormPage, ToExpression @ ToBoxes @ fullFormPage } // ColumnFormPage[FormObject[<|"country" -> ...|>|>], GeoGraphics[#country] & ] FormPage[FormObject[<|"country" -> ...|>, <||>], GeoGraphics[#country] & ]
<||>appeared inFormObject, there is no error because it is a validOptionsPattern[], and I wouldn't mind but aFormPageof this form misbehaves even for fully specified field:CloudDeploy[ ToExpression @ ToBoxes @ fullFormPage, Permissions -> "Public"]Berlin again...
Am I misusing Form* functions? Are those documentation's bugs or just bugs
CASE:3892750
p.s. related:
Problem with conversion of UI controllers' boxes to expressions
"Input"->"CH"works, but it still doesn't work with the blank field. I agree that looks like a bug with handling the"Default"parameter. – b3m2a1 May 22 '17 at 14:40GeoGraphics["CH"]. Which gives an error and my current location (yours must be Berlin). Try providing the full entity as the default value. And give"Input"->"CH"as the input value for the users. – b3m2a1 May 22 '17 at 14:45Interpreterto the default value. Useful to know, but also a definite potential stumbling block. – b3m2a1 May 22 '17 at 14:47Interpreteris applied to the default value? Haven't seen that one. – b3m2a1 May 22 '17 at 14:49spec->"Number"->3and of course it's ambiguous there. They ought to make it explicit that it doesn't apply, I agree. – b3m2a1 May 22 '17 at 15:18