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: 18
Registered: ‎04-19-2018
Accepted Solution

Mobile - Enable FieldActions with Javascript

[ Edited ]

Hi,

 

I try to add attribute IsEnabled to fieldActions and it work well:

 

Here's an example with Geometry Field:

 

<Geometry Name="geom" Title="Edit geometry">
	<GeometryFieldAction Target="NativeMap" Capture="True" Edit="True" GeometryType="Polygon" IsEnabled="False">
	     <Parameter Name="ZoomLevel" Value="22"/> 
	</GeometryFieldAction>
</Geometry> 

 

And also works with Table.Actions:

<Table.Actions>
	<NavigateFieldAction Target="CarForm" Icon="Plus" IsEnabled="False">
	     <Parameter Name="Field.Value.car_uid" Value="@{car_uid}" />             
	</NavigateFieldAction>
</Table.Actions>

Now I want to do that with Javascript depending on another field value.

 

Is it possible access to FieldActions using Javascript like simple Fields with function setEnabled? What parameter do I have to use? I've done some tests but I can't get it.. 

 

 

Thank in advance,

Regards.

 

 

 

Highlighted
Staff
Posts: 57
Registered: ‎10-25-2016

Re: Mobile - Enable FieldActions with Javascript

Hi eruiz,

 

this is currently not supported, but it would be possible to support that in an upcoming version.

 

Regards

Christian

Occasional Contributor
Posts: 18
Registered: ‎04-19-2018

Re: Mobile - Enable FieldActions with Javascript

Hi,

 

We've seen on the new version details (0.6.95) it's now implemented.

Could you update the documentation or add here an example to see how to do it via Javascript.

 

Thank you!

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

Re: Mobile - Enable FieldActions with Javascript

Hi eruiz,

 

it works like enabling or disabling a field:

 

Context.setEnabled('myfieldaction', false);

I'll improve documentation to make it more clear.

 

Regards

Christian

Occasional Contributor
Posts: 18
Registered: ‎04-19-2018

Re: Mobile - Enable FieldActions with Javascript

Hi Christian,

 

Yes, it's what we've tried.

 

For example, if we have this Image Picker:

 

 

<ImagePicker Name="img_field" Title="Image" >
     <TakeImageFieldAction/>
</ImagePicker>

 

I want with Javascript hide/disable the TakeImageFieldAction so.. whats the parameter 'myfieldaction' ?

Because if we put img_field, it disables the box but not the button itself. We have to add an Id parameter o something like this?

 

Thank you,

Regards.

 

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

Re: Mobile - Enable FieldActions with Javascript

Yes you have to give the field action a name attribute.

 

Regards

Christian

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.