PostFieldException
From Plex-XML
Used to insert any kind of code/output after a field.
It could be used for insert/update fields as well as for grid rows.
Hint: You could use the shape "customized" if don't want to generate or want to replace the normal grid-cell content.
Contents |
Nested structures
If you have nested structures of HTML in your exception you could put them in a postFieldException element. Otherwise they may occur multible times.
... <postFieldException> ...your nested HTML... </postFieldException> ...
Example
<xsl:template name="postFieldException">
<xsl:choose>
<!-- A link is generated after the field ATOFAC.
The click event of that link is observed by a [[generateLookup]]. -->
<xsl:when test="@implname='ATOFAC'">
<a href="#" id="get_ATOFAC" style="margin-left:5px;">nachlesen</a>
<generateLookup>
<event name="click" element="get_ATOFAC"/>
<requestname>ActTypSFXML</requestname>
<fill from="ATOfAT" to="TypeOfType"/><!-- TypeOfType -->
<fill from="ATOFAC" to="TypeOf"/><!-- Type -->
<return from="ActSub" to="ActSub"/> <!-- Subject -->
<return from="AcBody" to="AcBody"/> <!-- Body -->
</generateLookup>
</xsl:when>
<!-- A JScript is executet after ADesEn and the field value is set to 'KTR'. -->
<!-- (There other ways to set the value. E.g. the Format or the PlexDictionary Function) -->
<xsl:when test="@implname='ADesEn'">
<script language="javascript" type="text/javascript">
$('v<xsl:value-of select="$rid"/><xsl:value-of select="generate-id()"/>').value = 'KTR';
</script>
</xsl:when>
<!-- change background color of the field depending on its value -->
<xsl:when test="@implname='ColorFulState'">
<xsl:variable name="color">
<xsl:choose>
<xsl:when test="@unformatted='1'"><xsl:text>#99FF99</xsl:text></xsl:when>
<xsl:when test="@unformatted='2'"><xsl:text>#FFFF99</xsl:text></xsl:when>
<xsl:when test="@unformatted='3'"><xsl:text>#FF9999</xsl:text></xsl:when>
<xsl:otherwise>transparent</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<attrs style="background-color:{$color}" /><!-- you can set any other style attributes here -->
</xsl:when>
</xsl:choose>
</xsl:template>
Largebutton with text after a field
<xsl:template name="postFieldException"> <xsl:choose> <xsl:when test="@name='FooFoo'"> <button type="largebutton" text="Price adjustment" alt="Price adjustment" image="calculator.gif" > <xsl:call-template name="onClickNewWindow"> <xsl:with-param name="param"> <formName>INTD600AE</formName> <param value="{$vFooFoo}">IN Identcode</param> <action>P</action> </xsl:with-param> </xsl:call-template> </button> </xsl:when> </xsl:choose> </xsl:template>
Example how to replace the content of a whole fieldset:
<xsl:when test="@name='FooField'">
<!-- Get Fieldset-ID -->
<xsl:variable name="fieldsetID">
<xsl:for-each select="ancestor::tab//returnvalue[@implname='FooField']">
<xsl:for-each select="ancestor::group"><xsl:call-template name="genFieldsetID"/>_div</xsl:for-each>
</xsl:for-each>
</xsl:variable>
<!-- Load content with an AJAX-Request-->
<script language="javascript" type="text/javascript">
<xsl:text>ajaxPageLoad('</xsl:text><xsl:value-of select="$fieldsetID"/><xsl:text>','</xsl:text>
<xsl:value-of select="$vURL" />
<xsl:text>','request=FooRequestName&style=ajax');</xsl:text>
</script>
</xsl:when>
