Hoppa till huvudinnehållet

Add combo boxes to a display form at runtime

Kommentarer

6 kommentarer

  • Tom Neer
    I believe it is doable using the Geocortex Essentials WPF API ("C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\Workflow Designer\Geocortex Essentials WPF API.chm"), however, I have not yet had an instance to need to do this. It would be fairly complicated.

     

    An easier method would be to create your form items before hand and set the IsVisible to False. Then use Runtime Modifications to toggle their visibility when needed. I am not familar with the Cityworks Extension so I don't know if this would work.
    0
  • Permanently deleted user
    Thanks Tom

     

    That would work. My only concern is the space these invisible form items take. If I had to default say 5 invisible combo boxes, 5 invisible text areas, and 5 invisible data pickers to be able to handle permutiations of what I need to present coming from the CityworksAPI, I'm thinking it would create some odd looking forms with gaps. Any ideas on how that could be potentially managed at runtime?

     

    Cheers,

     

    Geoff
    0
  • Tom Neer
    Everything should collapse when not visible. I have not noticed any spacing issues for FormItems that are not visible. We've used this method for several years on lots of different workflows.
    0
  • Ryan Cooney
    Hi Geoff,

     

    Yes, you can create new form items on the fly.

     

    You have to create the item. new Geocortex.Forms.Client.Items.ComboBoxFormItem() Then assign your properties to it. Be sure to give it an ArgumentName otherwise it won't be included in the results.

     

    Then add it to the form's FormItems collection using the AddToCollection<FormItem> activity.

     

    To get at the results of form items added on the fly you will need to use the "Form Results" output of the Display Form activity. This is a dictionary keyed by the Argument Names.

     

    That said... I like Tom's suggestion. You don't need to actually create the controls on the fly, you can apply most of your layout and settings with the visual designer rather than in code and you can access the results of items right off the Display Form activity's design surface. Hidden form items don't take up any space, so your end users won't see a difference.

     

    --Ryan
    0
  • Permanently deleted user
    Thanks guys.Just took the Display Forms course and it went into just what you're talking about Ryan. I should be off to the races.

     

    -Geoff
    0
  • Permanently deleted user
    Hi Geoff,

     

    I am using the Cityworks extension as well. I am new to the Extension and the workflows in general. I saw you comments about adding custom fields/categories. I was wondering if you had it working? Thanks. Nataliya
    0

Du måste logga in om du vill lämna en kommentar.