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: 11
Registered: ‎05-11-2018
Accepted Solution

Session variable in Shell.xaml

Hi,

 

Is it possible to use a session variable in Shell.xaml?

 

I have the following list which displays areas and sets a session key (AREA_NAME) based on the users selection:

 

<List.SelectionScript>
		var AREA_NAME = = '';

		Context.setSessionKey(AREA_NAME, Context.getValue('Waste_Admin_Area'));

				
	</List.SelectionScript>
    <ListCell Name="Waste_Admin_Area" Title="AREA TO SURVEY" />

In the Shell.xaml I would like to use this key as a filter within my navigation like this:

 

<Navigation Id="AREA_STREET_LIST">
					
          <List Id="WMS_SURVEY" Title="Survey" View="AreaList" Entity="{x:Reference AdminArea}">
                       
		<List Id="SurveyList_CITY_CENTRE" Title="Streets To Survey" View="SurveyList" Entity="{x:Reference WMS_STREET_SURVEY}">
							<Form Id="SurveyFormCityCentre" Title="Street Survey" View="SurveyForm" Entity="{x:Reference WMS_STREET_SURVEY}" Target="SurveyList" />
							
			<List.Filters>

								
				<FilterRef Filter="{x:Reference AREA_NAME}" Title="AREA" IsDefault="False"/>

			</List.Filters>
							
							
		</List>
						
						
						
          </List>
										
</Navigation>

Is this possible?

 

The filters in the Shell.xaml will look something like this:

 

<Filter Id="AREA_CITY_CENTER" Sql="AREA = 'CITY CENTER'" IsDefault="False"/>

<Filter Id="AREA_NORTH_WEST" Sql="AREA = 'NORTH WEST'" IsDefault="False"/>

 

Thank you. 

Ciaran

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

Re: Session variable in Shell.xaml

Hi Ciaran,

 

If you set the session value in the selection script like that:

 

Context.setSessionKey('AREA_NAME', Context.getValue('Waste_Admin_Area'));

You should be able to use it in a filter in the following way:

 

<Filter Id="AREA_FILTER" Sql="AREA = @{AREA_NAME}" IsDefault="False"/>

 

Regards

Christian

Highlighted
Occasional Contributor
Posts: 11
Registered: ‎05-11-2018

Re: Session variable in Shell.xaml

Hi Christian,

 

This worked.

 

Thanks

Ciaran

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.