Problem with expression binding on a dataset

Hello all,

I have a custom property on the root container with a named query binding.
A set of drop downs with the data bound to a dataset (from a named query), and the selectedValue of the drop down is bound using an expression:

try({Root Container.current_oamb_pos}[{Root Container.Container OAMB Locations.Dropdown Location 1.row},'Position_ID'], 0)

The current_oamb_pos is the dataset supporting the drop down selectedValue.

In the Designer, each drop down has the correct selected value, but it does not display a label or string.
image

image

Once I go into Preview Mode, then the correct strings appear.
When I open the project, and enable the trial, the correct strings in the drop down do not appear, just as in the Designer without preview mode.

I threw a table bound directly to the .current_oamb_pos just to make sure the data was really there when the screen loaded.

I seem to remember reading a thread on data loading via queries versus component loading and firing binding events, but I cannot seem to find it (if it really applies anyway).

What am I missing?

Just want to put this near the top again. :slight_smile:

I have no idea what might be wrong. Probably something simple you haven't shared. Perhaps you should be using the dropdown's .selectedIndex to pick adjacent data from the dropdown's option data.

I don't see a selectedIndex available.

I discovered that if I replace the reference to the drop down custom property .row in the expression with a hard value, it works just fine.

I knew something was tickling the back of my brain on the timing of loading components, data and bindings, and I think this type of expression binding is what I was thinking of. Even though it's bound, I think if I could delay the firing of the expression or delay these particular components to load late, that may work. But I don't know if such a thing is possible.

For now, simply hard coding the row number will work just fine.

Edit:
Also, I think I need to set the behavior.noSelectionValue to zero...

.selectedIndex is not shown in the property editor, but is shown in the property binding selection dialog. You should use it for all indirection into the data prop.