Message Boards Message Boards

GROUPS:

FormLayoutFunction with RepeatingElement and inputs from prior FormObject

Posted 1 month ago
140 Views
|
0 Replies
|
0 Total Likes
|

I want to condition the second page of the form on inputs from the first page. Somehow RepeatingElement confounds this.

Step 1: A not-so-conditional conditional layout function

condlayoutfunc[priorinput_] := 
  Function[Column[{"Static input", Dynamic[#["values"]]}]];
FormFunction[{
   FormObject[{ "input" -> "Number"}],
   FormObject[{ "values" -> RepeatingElement["Number"]}, 
    FormLayoutFunction -> condlayoutfunc[#input]]}, Identity][]

Step 2: Make that a conditional layout function

condlayoutfunc[priorinput_] := 
  Function[Dynamic[Column[{input, #["values"]}]]];
FormFunction[{
   FormObject[{ "input" -> "Number"}],
   FormObject[{ "values" -> RepeatingElement["Number"]}, 
    FormLayoutFunction -> condlayoutfunc[#input]]}, Identity][]

That does not work. But if I omit the RepeatingElement

condlayoutfunc[priorinput_] := Function[Dynamic[Column[{input}]]];
FormFunction[{
   FormObject[{ "input" -> "Number"}],
   FormObject[{ "values" -> RepeatingElement["Number"]}, 
    FormLayoutFunction -> condlayoutfunc[#input]]}, Identity][]

It works -- though doesn't really do much. What am I missing? How to make the FormLayoutFunction conditional on inputs from prior pages for a page that includes RepeatingElements?

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