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,
Did you hear about the Interactive Automation Script Toolkit?
You should be able to use this to implement a dropdown,
in the dialog you could do something like:
ResourceSelectionDropDown = new DropDown { Width = 300, IsDisplayFilterShown = true };
AddWidget(ResourceSelectionDropDown, 0, 0);
ResourceSelectionDropDown.Changed += Resource_Selected;
and your method would look like
private void Resource_Selected(object sender, DropDown.DropDownChangedEventArgs e)
{if (String.IsNullOrWhiteSpace(ResourceSelectionDropDown.Selected) || ResourceSelectionDropDown.Selected == Na)
{
return;
}
// do something with ResourceSelectionDropDown.Selected}
Hope this help a bit.
Thank you for sharing this but I am far too gone in my script to use this so if you have anything to help with BlockType elements, please do share.
Hi Curtis, I would still highly recommend to work with the IAS Toolkit. Regardless of the size of you current script you will, in the long run, increase your readability and the maintainability to rework it. I don’t think Skyline has created scripts implementing this kind of logic in the last +/-4 years.
That being said, I do understand your position so, there is no better way to get events on UIBlocks that I know of…. There might be something wrong with the structure of your code? In the background an IAS using UIBlocks requires a do while loop. In the do you will implement your uiblocks and uir.WasOnChange(“DropdownName”). But i’m not an expert on that, I hope someone else can further help you out with this.
this problem is solved now