8
Views
9
Comments
Solved
FetchingDataOnDemand Exercise Small Issue

I was able to follow the explanation pretty well.
I was expecting to run smoothly but yet again have a problem and can't solve it.

Example: Contact information - Country ; State; City.

We have to add 3 Dropdown Widgets for the Country, State and City and when I select "Spain", the states need to be only from spain and the same for the cities.

I manage to do that for the state and did exactly the same for the city with the function:

City.StateId = GetEmployeeById.List.Current.Employee.StateId


I don't have any errors in the program so I Click to publish..

When in the browser:

I select the country (no prob).........States appear accordingly.........but cities.....ZERO...press the (down arrow) and I get one small black box...

What could it be??

mvp_badge
MVP
Rank: #68
Solution

Basically what you had before was:
OnChangeCountry refresh getCountry
OnChangeState refresh getStates
OnChangeCity refresh getCities

But you can see what you did by using the "Compare with another version" option (same menu) and choosing the previous version.

Yes, when you change the country, you should refresh the list to filter the states by that same country.

mvp_badge
MVP
Rank: #68

Hello Bruno.

Can you share the oml?

From the expression you shared, the cities will only show after you select the state. I'm not understanding what you mean by small black box...

mvp_badge
MVP
Rank: #91

Hi Bruno,

Please check the below pointers

1) Is the Aggregate mapped with the city dropdown get refreshed on the state dropdown onchange?

2) Is the Aggregate with City as source does have the proper Filer condition defined?

3) Is for the selected state there exists any city records available in the City entity?


If possible could you please share the .oml file for us to understand the exact implementation which you did.


Regards,

Benjith Sam

mvp_badge
MVP
Rank: #68

The oml is the module.

You can download it from the menu.

Rank: #7601

While trying to solve the problem...I eventually did the same for the state...at this point I so confused...

FetchingDataOnDemandExerciseerro.oml

mvp_badge
MVP
Rank: #68

You simply mixed the places.

When you change Country (calling CountryDropdownOnChange) you must refresh the GetState query.
When you change State (calling StateDropdownOnChange) you must refresh the GetCity query.
And when you change city, there is nothing left to do.

I also fixed the city filter to be what you said first.


FetchingDataOnDemandExerciseerro.oml

mvp_badge
MVP
Rank: #91

Hi Bruno,

On the change/selection of the State dropdown option you will have to refresh the City Aggregate, which should be defined with a filter condition like

City.StateId = GetEmployeeById.List.Current.Employee.StateId

OnChange for City dropdown is not required.

See the attached .oml file


Hope this helps you!


Regards,

Benjith Sam

FetchingDataOnDemandExerciseerro.oml

mvp_badge
MVP
Rank: #68
Solution

Basically what you had before was:
OnChangeCountry refresh getCountry
OnChangeState refresh getStates
OnChangeCity refresh getCities

But you can see what you did by using the "Compare with another version" option (same menu) and choosing the previous version.

Yes, when you change the country, you should refresh the list to filter the states by that same country.