GenerateLookup
From Plex-XML
Read Fields via Ajax Request. We use it to do Calculations based on entry fields or lookup descriptions and so on.
- generateLookup : the Element name to use to generate the Event Handler
- actionBefore : JScript that is executed before the lookup is done
- event : the event for which the Event Handler is installed
- name : name of the Javascript event, 'click','change','blur',..
- elementname : Name of the entry field the Event Handler is attached to, OR
- element : ID of the entry field the Event Handler is attached to
- prototypeEvent= could be used to observe a customized prototype event [1] e.g.: "{@name}:" (DON'T FORGAT THE : AT THE END)
- requestname : the Web-Request to execute
- fill : Parameter(s) for the WebRequest
- from : name of the field the parameter value comes from, OR
- fromid : id of a field the parameter value comes from, OR
- fromvalue : a fix value that should be used as parameter value
- to : name of the parameter
- return : the response field(s) that are used
- from : name of the response field
- to : name of the field in the webpage to receive the response value
Example
<xsl:template name="postFieldException">
<xsl:choose>
<xsl:when test="@name='ATOFAC'">
<a href="#" id="get_ATOFAC" style="margin-left:5px;">nachlesen</a>
<generateLookup>
<actionBefore>console.log('Hi!');</actionBefore>
<event name="click" element="get_ATOFAC"/>
<requestname>MyEntitySFXML</requestname>
<fill from="ATOfAT" to="KeyValue"/>
<fill fromvalue="aFixValue" to="anInputField"/>
<return from="ActSub" to="ActSub"/>
<return from="AcBody" to="AcBody"/>
</generateLookup>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--within the global "F4" it is slightly different cause it is defined at the second filter level -->
<xsl:template name="F4">
<xsl:choose>
<xsl:when test="contains(@impl,'ProID')">
<xsl:call-template name="generateLookup">
<xsl:with-param name="param">
<event name="change" element="{@hid}"/>
<requestname>ProjectSFXML</requestname>
<fill from="ProID" to="ProjectID"/>
<return from="ProDesc" to="ProDesc"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
As a Plex base function you could use a SingleFetch (e.g. MyEntity.XML_Intern.BaseServices.SingleFetch) when the base is a Dictionary function you should use "aaGetAJAXDictXML.xsl" as the filter XSLT
request-config
<webrequest name="MyEntitySFXML"> <request name="MyEntitySF"> <plex-parameter type="web" name="FetchKey_MyEntityKey">KeyValue</plex-parameter> </request> <response> <error type="default" name="DEFAULT"/> <reaction type="DEFAULT" target="DISPLAY" localized="true" mime="text/xml" usedefaultstyle="false" name="/WEB-INF/resources/@common_html@/aaGetAJAXXML.xsl"/> </response> </webrequest>