Official Content

The definition of a User Control for Native Mobile applications is similar to the User Control definition, with a few additional properties. Notice that the User Control editor is only available for User Controls.

To create your own User Control for Native Mobile applications, copy and paste an already existing one and modify the following tags.

  • Change the User Control Name and Description.
  • Set the Version tag to an initial value.
  • Set the user control properties in an XML file and reference it in the PropertiesDefinition tag 
<PropertiesDefinition>UserControlNameProperties.xml</PropertiesDefinition>
  • Set the Platform to "SmartDevices".
<Platforms>
  <Platform>SmartDevices</Platform>
</Platforms>
  • If the control is a list one, make sure to set the List value on the ControlType tag:
<ControlType>List</ControlType>

 

Implementation of specific values

Then, you must fill in the platform specific values.

For iOS

  • You need to package your user control as a library and reference a bundle (resources) if needed using the iOS_SupportFiles property.
<iOS_SupportFiles>
  <File>libmyUC.a</File>
  <Directory>myUC.bundle</Directory>
</iOS_SupportFiles>
  • Declare the class in charge of the User Control for Native Mobile implementation using the iOS_ClassName tag.
<iOS_ClassName>SampleUCMainClass</iOS_ClassName>

For Android

  • Declare the class in charge of the User Control for Native Mobile implementation using the Android_ClassName tag.
<Android_ClassName>com.mycompany.extendedcontrols.sampleuc.mainclass</Android_ClassName>

 

Adding platform default value

Since GeneXus 15 Upgrade 4 it is possible to specify the pd (platform default) value in dips associated with the user control by adding a tag to its definition (*.control file).

For iOS

  • Declare the value in dips using the iOS_PlatformDefault tag.
<iOS_PlatformDefault>80</iOS_PlatformDefault>

For Android

  • Declare the value in dips using the Android_PlatformDefault tag.
<Android_PlatformDefault>80</Android_PlatformDefault>

For both

  • Declare the value in dips using the PlatformDefault tag.
<PlatformDefault>80</PlatformDefault>

Note

Since Genexus 16 upgrade 2, when defining a user control of type List, you are able to hide the Row property, and you can also indicate a fixed value. Example: Inside the GeneXus installation directory (Gx installation directory UserControls \ SmartDevicesMapControl \ sdmapcontrol.control) you can find the user control SDMaps :
<Overrides>
   <Property>
   <Id>rows</Id>
   <Visible>false</Visible>
   <Value>&lt;unlimited&gt;</Value><!-- does not support paging, so it must be unlimited -->
                ....
</Overrides>  

Note that in the example, the property Row is hidden, and the unlimited value has been set.

 

GeneXus activation

Execute GeneXus with the /install option and make sure it is available.


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant