I have tried to use the UIResult GetString() method and it works but the WasOnChange method always returns false. Can anyone confirm if there is better method to check event changes with a UIBlockType.DropDown.
Hi Curtis,
How are you defining your Dropdown block definition?
If you use the uibuilder.AppendDropDown, will not enable the on-change option for you.
You would need to define a UIBlockDefinition and use the method uibuilder.AppendBlock and in the UIBlockDefinition you need to make sure you set the WantsOnChange property to true
I just set the this parameter to be true but now every time I select a different option in the dropdown my script crashes.
UIBlockDefinition dropdownBlockItem = new UIBlockDefinition
{
Type = UIBlockType.DropDown,
Text = “Polling”,
InitialValue = initialValue,
Row = row,
Column = column,
Width = 70,
DestVar = “dropdown_polling”,
WantsOnChange = true
};
Do you have an error message or does it show anything in the information events that would indicate the cause of your crash?
According to the documentation link on my original answer, it should be compatible with dropdowns
No error messages but I might have used the wrong word. In DataMiner terms it completed succeeded after a change. It is working but ends the script, which is strange.
Without knowing how your entire code is, I could be suggesting things you already have in place, however, I would check if you have the UIResults object verifying the events and reading the data from the block definitions.
After those events are checked and if you still want to remain on the same screen, there should be a loop that sends you back to the code where it draws the screen.
this problem is solved now