Hi everyone ,
today iam working on Employee Directory project ,i have created 3 dropdowns one for country, one for state, one for city. On selecting the country dropdown i need to get the respective states only, and also respective state cities.
this is working fine when i am creating new Employee ,but the dropdowns of state and cities are not showing when i click on the already existing data which is already created.
iam unable to fetch the data in the dropdown when i clicked on the respective id or name .
Hi @jayakrishnasai Korikana ,
You need to refresh the States aggregate in OnAfterFetch action of Employee aggregate to get existing state details. Please find attached oml for reference.
Hope this helps.
Regards,
Anjali D.
Hi @Anjali_Dange thanks for replying but i have already refresh the States aggregate in OnAfterFetch action of Employee aggregate
Hello, @jayakrishnasai Korikana
I have created an oml , please check Detail Screen,
Hope this will help you,
Thanks ...
Heello @jayakrishnasai Korikana ,Seems like the oml dont have data in entity of state and city.rest code seems good to me.Can you please verify wheather your state and city entity having data or not?
Hi @Yogesh Javir the dropdowns are working fine only when i refresh the page , i even opened in the incognito also but still i have to refresh this page again and again .
Hello @jayakrishnasai KorikanaAt the time of retrival data you need to refresh state aggregate (GetStatesByCountryID) on after fetch of GetEmployeeById aggregate.and you need to add filter like
GetEmployeeById.List.Current.Employee.CountryId =NullIndentifier() or State.CountryID = GetEmployeeById.List.Current.Employee.CountryIdthis will help you
hi jayakrishnasai Korikana, While Creating As @Yogesh Javir said, check your Database for State and City details there is no data. if Data available then i dint find any issues in your oml, you refreshed state and city with required filter in your code so there is no issue in oml.
if you are saving all the data's but during retrieve there is an issue means, please debug and check the particular entity.
if all country ,state and city mapped correctly then you will get correct output.
hope this helps you.
Hi @Lavanya-EONE thaks for the reply it is working fine but sometimes the data in the dropdowns was not displaying unless i refresh again especially for State dropdown .
Thank you
Your dropdown was correctly filtered. so, no issues in that kindly check your entity details correctly, May it take time to load.
@Lavanya-EONE not sure why you need to stay on same page after successful employee record insertion. It will be better to redirect the user one dashboard page.
Although you can fix the issue by passing the newly created/updated employee Id to the same page in saveOnClick event and it will resolve the issue.
Find the attached Oml
Mark as as Solved please if it helped
hello @jayakrishnasai Korikana
I hope it's help you