Message Boards Message Boards

0
|
1816 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

FormLayoutFunction with RepeatingElement and inputs from prior FormObject

Posted 2 years ago

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?

POSTED BY: John Vande Vate
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