Populate List Box based on Existing Values
I am trying to use RunTime Mods in the Display Form to highlight or select a value in my ListBox. My values are 1, 2, and 3, which I am adding as data items in the Design Form gui. The value is being assigned before the form appears, I just want to highlight that value in the ListBox. The task is having a user review existing attributes of a feature, but that person needs to see AND be able to change those values.
I have tried setting my RunTime assign to: form.Find(Of ListBoxFormItem)("ListBox1").SelectedValues = myDataItemList
However, when I print my item in my For Each loop for my Data Item List thjat the value gets appended to, I get "GeoCortex.Forms.Client.DataItem", I wish I could just put the string in to replace myDataItemList, but the variable required to use SelectedValues must be a DataItemList.
Anyone have any workflow examples or suggestions on getting a queried attribute from a feature service and highlight that value in a ListBox?
many thanks!!!
Ryan
-
This is what I make it work.
(1) Declare a variable with the type "IList<Object>" (say you call as 'listSelected'
(2) On the Runtime Modification Sequence, Assign 'listSelected' with the variable your Ouput Arguments of the ListBox (if you configured it as ' listBoxSelectedItem ' which should be with the type 'Object'
(3) Use Assign Activity (Cast<T>): listSelected = listBoxSelectedItem
(4) Use Assign Activity (Cast<T>): form.Find(Of ListBoxFormItem)("ListBox1").SelectedValues = listSelected
0 -
Munwhan,
Thanks for the reply. I am stuck now on #2 of your steps. I can't assign the object var (output of the ListBox) to the Casted iList<Object> variable in the RunTime mod. It won't let me. I am unsure why I am assigning a var to an output that doesn't exist yet??
Do you have any examples or have time to create a SUPER simple one, just so I can see what the var's are and their types?
thanks,
Ryan
0 -
Actually, I think I see what you are saying with #2. But #3 and #4... Is this a Cast or an Assign? I am a bit confused by what you are describing. I can't Cast those and the Assign doesn't make a difference.
thanks again,
Ryan
0 -
Got it. Thanks for your insight Munwhan... it definitely pointed me in the right direction. I think I got stuck too because I was trying to highlight a record that was coming from the value from a coded value domain.
Ryan
0 -
Ryan,
I know this thread is almost 3 years old, but I am trying to do exactly what you were asking here. I can't get it to work, but it looks like you did.
If you have it available, would you be willing to post a snippet of the workflow, so I can see where I'm going wrong?
Thanks,
Mike0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
5 Kommentare