Zum Hauptinhalt gehen

Accessing listbox object array results

Kommentare

3 Kommentare

  • Permanently deleted user

    The results from a ListBox are held in an Object. So you'll need a variable of type Object to hold the results (even if it is a list of strings -- we can't assume this). Then you can convert this to a List(of Object), and finally grab each object and convert it to a string.

    Use a ForEach<Object> loop to do this. The top will read something like:

    Foreach thing in CType(myObject,List(of Object))

    and then you can use thing.ToString() in the body of the loop to get the actual string representation of each item.

    0
  • Permanently deleted user

    Thanks for the reply, Jonathan.  This will be very helpful.  I'm trying to keep it focused on just using the activities from Workflow Designer.

    1.  Create listbox multiple form

    2. Create an object variable objectUseCode and use it as the output argument for the listbox multiple

    3.  Use a ForEach loop to convert - the only ForEach loop that I have available to me in Geocortex Workflow Designer is a ForEach<Int>

    Foreach item in CType(useCodeMulti, List(Of Object))

    I get  a ! error on that line in the ForEach<Int32> so I created a object variable called objectInList and tried that but it doesn't work either:

    Foreach objectInList in CType(useCodeMulti, List(Of Object))

    As I look thru the activities in the Workflow Designer, it seems like there aren't enough tools in there to do this.  So do I have to build a custom activity to do this? 

    This is the palette of tools from the toolbox for reference sake:

    /customer/servlet/servlet.FileDownload?file=00P6000000e87yWEAQ

    0
  • Permanently deleted user

    It is intended and expected that you will change the type of the ForEach loop to reflect the type of variable that you are working with. If you click on the ForEach construction and look at the right hand pane you will see a value for 'TypeArguement'. This controls the type of variable you are looping through. While Int32 is the default, it will actually rarely be useful to you to loop through this type of variable when working with map objects in workflow.

    In general, whenever you see the notation <T>, as in ForEach<T>, this denotes that you will have to select a type <T> of variable to operate on. 

    There are a couple of references which will be invaluable when working with Workflow. If you encounter strange variable types that you are not familiar with you can look them up on the Microsoft Developer's Network. For example, you may run into IEnumerable<T>, which is a required output from some tasks, usually in the form IEnumerable<ESRI.ArcGIS.Client.Graphic>. This simply means that you have a countable collection of map graphic objects, but you can look up more info on how to use this type here:

    http://msdn.microsoft.com/en-us/library/9eekhta0.aspx

    And if you want to know more about ESRI Graphic objects, you can use the ESRI API reference:

    http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Graphic.html

     

    0

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