Hexagon Geospatial
MENU

M.App Enterprise

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 9
Registered: ‎11-15-2018
Accepted Solution

Mobile: How to configure depending pickers in mobile app

Hello,
is there a possibility to configure two pickers for example picker A for countries
and picker B for cities where you first select country in picker A
and picker B only shows all cities which belong to chosen country?

 

Picker A and B should get their infos from database:
for example:
table A: list of country
table B: list of country, city


Regards,
Iris

Staff
Posts: 41
Registered: ‎10-25-2016

Re: Mobile: How to configure depending pickers in mobile app

Hi Iris,

 

here is an example how to define depending pickers:

 

<Entity Id="Countries" Table="countries" Key="id" SyncType="Automatic">	
	<Field Name="id" Type="Guid" IsRequired="True" />
	<Field Name="name" Type="String" IsRequired="True" />
</Entity>
<Entity Id="Cities" Table="cities" Key="id" SyncType="Automatic">
	<Entity.Filters>
		<Filter Id="CountryFilter" Sql="country_id = @{country_id}" />
	</Entity.Filters>
	<Field Name="id" Type="Guid" IsRequired="True" />
	<Field Name="country_id" Type="Guid" IsRequired="True" />
	<Field Name="name" Type="String" IsRequired="True" />
</Entity>

<Picker Name="country_id" Title="Country" KeyMember="id" DisplayMember="name" Items="{Entity Countries}" />
<Picker Name="city_id" Title="City" KeyMember="id" DisplayMember="name" Items="{Entity Cities, Filter=CountryFilter}" />

 

Regards

Christian

Occasional Contributor
Posts: 9
Registered: ‎11-15-2018

Re: Mobile: How to configure depending pickers in mobile app

Great, that works!


Assuming there are multiple entries of one city in table 'cities' (due to additional informations)
is there a way to only show distinct results in picker city_id?

 

Thank you very much,

regards, Iris

 

Staff
Posts: 41
Registered: ‎10-25-2016

Re: Mobile: How to configure depending pickers in mobile app

Hi Iris,

 

the easiest way would be to create a database view which gives you a distinct result of your cities.

 

Regards

Christian

Contributor
Posts: 27
Registered: ‎02-22-2017

Re: Mobile: How to configure depending pickers in mobile app

Hi,

 

I created a database view to have a distinct list of my object.

 

And how can I use this database view in my picker? I tried it with a new Entity in the Shell.xaml but it doesn't work. 

 

 

 

Regards, Maike

Polls
Please register to vote
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Development Ticket through our Development Ticket Portal.