Hoppa till huvudinnehållet

Add Dropdown List of Layers to DisplayForm

Kommentarer

2 kommentarer

  • Permanently deleted user
    Hi Krystal, 

     

    To provide a dropdown list of all your layers and columns in the display form is possible. However, it can get fairly complicated to implement depending on how you want it to work. 

     

    The easiest way of doing this would be to hardcode your layer names and column names in the workflow. You will create 2 lists (of type data item), one for the layers and one for the column names. From there, all you would need to do is reference those lists in the Display Form under "Input Data".

     

    If you want to filter out the column names so that it corresponds to the layer that the user chooses, then you would have to split this up into 2 display forms. The first display form would allow the user to choose the layer, then based on the layer that the user chooses, the 2nd display form will only display column names from that layer. To filter out the column names, you can have 1 list of column names per layer. This would be the easiest to implement.

     

    If you want the layer names and column names to be retrieved dynamically, then this can get fairly complex. You can use the Web Request activity to retrieve the Essentials REST endpoint of the site. This activity returns a byteArray, which you can convert into a string using the GetTextFromBytes activity. From here, you will need to extract the information by parsing the long string and creating a list/dictionary/array to hold the information. Once you have the information you need in lists, it works the same way as the first method where you would simply reference the list of data item in the display form under Input Data. 

     

    I hope this provides more insight into what you are trying to do. Of course, there are more ways to accomplish this task but these are just 2 examples to show you what you can do. Please let me know if you have any questions. 

     

    Carmen
    0
  • Erik Engstrom
    You could add a property to any layer that you'd like to participate in the dropdown for the search. The property accepts a name and value. Both could be the same thing, in this case, perhaps "selectable". 

     

    You'd then use the "GetLayerInfoByProperty" activity to return the layer information for each layer that matches the set property, in this case "selectable". This returns a list of EssentialsLayerInfo: http://gedemo.geocortex.com/SamplesViewer/#geocortex.essentials.EssentialsLayerInfo

     

    Use the list to dataItemList and use the Name/Id properties for the display/value columns. You could then use this dataItemList to populate the Input Data of your combo box used for selecting the selectable layer.
    0

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