Modeless Form SDK Sample - 2 Requests for one single button

Modeless Form SDK Sample - 2 Requests for one single button

tiagofrbr
Contributor Contributor
170 Views
1 Reply
Message 1 of 2

Modeless Form SDK Sample - 2 Requests for one single button

tiagofrbr
Contributor
Contributor

Hi!
I've been studying the sample ModelessForm_ExternalEvent from SDK and I would like to know how to make two requests in one single button click. It would be something like the code below, however only the latter request seems to be executed.

private void UpdateButton_Click(object sender, EventArgs e)
{
    CheckedListBox.CheckedItemCollection checkedItems = DiagramsListBox.CheckedItems;

    if (checkedItems.Contains("Terminal Circuits"))
    {
        MakeRequest(RequestId.UpdateTerminalCircuits);
    }
    if (checkedItems.Contains("Panel Data"))
    {
        MakeRequest(RequestId.UpdatePanelData);
    }
}

 

0 Likes
171 Views
1 Reply
Reply (1)
Message 2 of 2

Michael_Coffey_G
Contributor
Contributor

You can make a static Data class with static properties to store info to pass between your form and the RequestHandler.  Utilize one RequestId and store the checked items in a static property.  On the RequestHandler side, process them as a list of items.  Clear the list after you've used them.

0 Likes