Creating a User Control Definition for Smart Devices

Official Content
This documentation is valid for:

To be able to use the user control in GeneXus, you need to provide the user control definition. The definition of a User Control for Smart Devices is similar to the User Controls, with a few additional properties. Notice that the User Control editor is only available for User Controls.

To create your own User Control for SD 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 SD implementation using the iOS_ClassName tag.
<iOS_ClassName>SampleUCMainClass</iOS_ClassName>

For Android

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

 

Adding platform default value

As of 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.