Zum Hauptinhalt gehen

How to iterate through form item controls inside RuntimeModifications?

Kommentare

4 Kommentare

  • Nico Burgerhart
    Use the Form Results out argument of the Display Form.

     

    This is a dictionary with the argument name as key and the value of the form item as value.

     

    You can loop through this dictionary.
    0
  • Nico Burgerhart
    My example above is to get the value afterwards. I see now you want to get the argument name in the runtime modification.
    0
  • Permanently deleted user

    Was just looking for this myself.

    Think I have found the solution..... by looping through all the form.FormItems in the runtime modifications.

     

    So.....

     

    1. Create a form and add all relevant checkboxes to the form

     

    2. in the "runtime modifications" add a ForEach activity

     

    3. change the TypeArgument on the ForEach activity to "Geocortex.Forms.Client.Items.FormItem"

     

    4. add an if statement to the loop so we only tick the Checkboxes (not other types of form items). If the item is a checkbox add an Assign activity to "tick" the box.

     

    E.g. The if statement would be like:

     

    If item.ItemID.Contains("CheckBox")

     

    Then

     

    form.Find(Of CheckBoxFormItem)(item.ItemID).Checked = True
    0
  • Permanently deleted user
    Sorry just read your description again, but if you want to tick checkboxes based on the the ArgumentName then just change the if statement or change it to something like a switch statement
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.