I have this code for a dropdown to set the current item to selected. I remember there was a bug that was fixed in an EPC when selecting the current item it would show the wrong column.
This code doesn't work to show the entry, even though I've seen it execute in debug
selectList #dropDown1
if (#SHACCO001 = #svShp)
#dropDown1.CurrentItem.visible #dropDown1.currentItem.selected := true
signal eShipperSelected pShipperNo(#ShAcco001)
leave
endIf
endSelect
#PRIM_MD.Dropdown set selected VL-WEB
#PRIM_MD.Dropdown set selected VL-WEB
Art Tostaine
Re: #PRIM_MD.Dropdown set selected VL-WEB
Art,
you have to do something like this:
so your code could be replaced with :
rather than having to iterate the list.
B.
you have to do something like this:
Code: Select all
* CODE TO LOAD DROPDOWN:
#dropDown1.AddItem Value(#shpVal) Caption(#shpCaption)
#dropDown1.AddItem Value(#shpVal2) Caption(#shpCaption2)
* Below code sets the 'selected' item as #shpVal (first item i added).
#dropDown1.Value := #shpVal
Code: Select all
#dropDown1.Value := #svShp
B.
Re: #PRIM_MD.Dropdown set selected VL-WEB
Thank you. I was looking in the docs! I promise.
Art Tostaine
Re: #PRIM_MD.Dropdown set selected VL-WEB
My Dropdown has 2 columns, customer name and number. Setting the value of the DD to the number doesn't work.
The dataclass parm doesn't let me set it to the number.
Is there something else I need to do?
The dataclass parm doesn't let me set it to the number.
Is there something else I need to do?
Art Tostaine
Re: #PRIM_MD.Dropdown set selected VL-WEB
Art,
could you please share your code for creating the dropdown?
I wasnt aware that #prim_md.Dropdown allowed 2 columns....
B.
could you please share your code for creating the dropdown?
I wasnt aware that #prim_md.Dropdown allowed 2 columns....
B.
Re: #PRIM_MD.Dropdown set selected VL-WEB
Sorry, I didn't write this code and missed a lot of things here.
Here is the add to the dropdown. This is what I meant by columns. I need to use the correct words for the MD controls.
#DropDown.Items.Add( #shAcco001.AsString #shName )
I am able to set the current value, but something weird is happening. I set the value, but it doesn't appear until I mouse over the drop down. There are no mouse over events defined. I'm going to try it in a test web page to see if it's something with my RP.
Here is the add to the dropdown. This is what I meant by columns. I need to use the correct words for the MD controls.
#DropDown.Items.Add( #shAcco001.AsString #shName )
I am able to set the current value, but something weird is happening. I set the value, but it doesn't appear until I mouse over the drop down. There are no mouse over events defined. I'm going to try it in a test web page to see if it's something with my RP.
Art Tostaine
Re: #PRIM_MD.Dropdown set selected VL-WEB
Ahh... gotcha...
#DropDown.Items.Add( #shAcco001.AsString #shName )
is the same as
#DropDown.Items.Add Value(#shAcco001.AsString) Caption(#shName)
(There is actually a 3rd Parameter 'Result' -- boolean ^H^H^H^H^H^H^H object to let you know that the add succeeded or failed.)
so to set the value you do:
#DropDown.Value := #shAcco001.AsString
#DropDown.Items.Add( #shAcco001.AsString #shName )
is the same as
#DropDown.Items.Add Value(#shAcco001.AsString) Caption(#shName)
(There is actually a 3rd Parameter 'Result' -- boolean ^H^H^H^H^H^H^H object to let you know that the add succeeded or failed.)
so to set the value you do:
#DropDown.Value := #shAcco001.AsString