I have the following set on the DisplayMode of my button:
If(
IsBlank(TextIncidentName.Text) && (IsEmpty(ComboBoxIncidentCategories.SelectedItems) || IsBlank(ComboBoxIncidentCategories.Selected.Name)), DisplayMode.Disabled, DisplayMode.Edit
)
However as soon as the textbox TextIncidentName is populated, the button is enabled.
Even when IsEmpty or IsBlank evaluate to true for the Combobox, the button is enabled.
The brackets in bold are intended to group the OR but I'm not sure I've done this correctly.
Hi @DuncanIVH,
If you want to change the displaymode on either TextIncidentName being empty or Selected Items being empty I would use an OR (||) instead of an AND (&&)
Can you try this instead:
If(IsBlank(TextIncidentName.Text) || IsEmpty(ComboBoxIncidentCategories.SelectedItems.Name), DisplayMode.Disabled, DisplayMode.Edit)
Yet another way to write it would be (Assuming you just want the button enabled only when both an item is selected and text has been entered.
If(Or(IsEmpty(ComboBoxIncidentCategories.SelectedItems),IsBlank(TextIncidentName.Text)),DisplayMode.Disabled,DisplayMode.Edit)