Skip to main content

Creating a completely Dynamic Form

Comments

9 comments

  • Berend Veldkamp

    Could you maybe provide us with a small sample workflow that reproduces this behaviour?

    0
  • Permanently deleted user

    Have you tried returning the results of your DisplayForm in a Dictionary?

    Might be worth a shot to see if it fixes your problem.

     

     

     

     

    0
  • Berend Veldkamp

    I just tried that suggestion, and it seems to be working. Set the Form Results property of the DisplayForm to a new variable of type Dictionary<String, Object> , and make sure that every form items has set its ArgumentName property. For instance:

    new CheckboxFormItem() With { .Text="Check this out", .Checked=True, .ArgumentName="MyCheckBox" }

     

    The keys of the dictionary will be set to the argument names of the formitems.

    0
  • Permanently deleted user

    Ash or Berend, would it be possible for you to post a workflow example? I'm interested to see how you did so much of this dynamically.

    Thanks

    0
  • Permanently deleted user

    I've tried what was suggested (including the Workflow) and it works well in the Workflow Simulator, but when the workflow is attached to a SL Viewer (v3.15) nothing comes through from the Form Results. I'm yet to try it on a later version of the the viewer but will try that too.

    0
  • Permanently deleted user

    Just to follow up, our vendor has confirmed it doesn't work in v3.15 with SL 1.10 or 1.10.1 but it works fine from 4.0

    0
  • Permanently deleted user

    A bit late back to the party, but thanks everyone for the replies and suggestions. We figured out setting the Form Results to a Dictionary was the trick (as suggested by 'Corporate Mapping, TMR' and confirmed by Berend Veldkamp), but forgot to update this thread with the results, so I'm glad someone else picked up the slack. Thanks again for everyones help!

    0
  • Permanently deleted user
    Hi, many thanks for the above solution, I realize that this thread has been quite for a while, but on the topic of dynamic forms, and runtime mods, I have a problem trying to implement validation

     

    I have got the following

     

    new TextBoxFormItem() With { .DefaultText=itemList.Attributes(tableAttributeCommentName).ToString, .ArgumentName=itemList.Attributes("OBJECTID").ToString, .Label= New LabelFormItem() With {.Text = itemList.Attributes(tableAttributeName).ToString }, .ValidationItems = New ValidationItemCollection(new RegexValidationItem() with {.Expression = "^[+]?\d+$" }) }

     

    And get the error ValidationItemCollection not defined

     

    Any help on dynamically adding validation would be gratefully appreciated
    0
  • Amanda Frech
    Hi Chris,

     

    The "ValidationItemCollection not defined" error can likely be resolved by either
    • Changing New ValidationItemCollection to New Geocortex.Forms.Client.Items.Validation.ValidationItemCollection?
    • Opening the "Imports" pane (at the bottom of Workflow Designer, next to "Variables" and "Arguments" and adding the namespace Geocortex.Forms.Client.Items.Validation
    I think that this will still give you trouble though, as ValidationItems is a read-only property for the TextBoxFormItem.  Try using the AddtoCollection activity to add the new RegexValidationItem to the existing ValidationItems property on the TextBoxFormItem.

     

    Hope that helps!

     

    Amanda
    0

Please sign in to leave a comment.