Note: If you want to create a user control, as of
GeneXus 16, it is strongly recommended to create a
User Control object, although what is explained in this article is still valid.
This document specifies how the User Control called Hello World must be displayed at design time in the GeneXus IDE.
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="[http://www.w3.org/1999/XSL/Transform|http://www.w3.org/1999/XSL/Transform]"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:gx="urn:shemas-artech-com:gx"
exclude-result-prefixes="msxml gx"
xmlns:gxca="urn:GXControlAdap">
<xsl:output method="html"/>
<xsl:template match="/" >
<xsl:apply-templates select="/GxControl"/>
</xsl:template>
<xsl:template match="GxControl">
<xsl:choose>
<xsl:when test="@type = 'HelloWorld'">
<xsl:call-template name="RenderHelloWorld"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- HelloWorld design render -->
<!-- /////////////////// Implement your render here ///////////////////-->
<xsl:template name="RenderHelloWorld">
<span atomicselection="true">
<xsl:call-template name="AddStyleAttribute"/>
Hello World control
</span>
</xsl:template>
<!-- Helpers Templates -->
<xsl:template name="AddStyleAttribute" >
<xsl:variable name="Style">
<xsl:text>width: </xsl:text>
<xsl:value-of select="gxca:GetPropertyValueInt('Width')"/>
<xsl:text>; </xsl:text>
<xsl:text>height: </xsl:text>
<xsl:value-of select="gxca:GetPropertyValueInt('Height')"/>
<xsl:text>; </xsl:text>
<xsl:text>border-style: solid; border-width: 2px;</xsl:text>
</xsl:variable>
<xsl:attribute name="style">
<xsl:value-of select="$Style"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>