GenerateCombo

From Plex-XML

Jump to: navigation, search

Could be used for a ComboBox that is loaded by an AJAX-Request.

Plex

MyEntity is a PLEXML_A/XML_ComboBoxIntern

Example

Inside of a postFieldException a ComboBox is generated when the field ATOFAC has the shape 'Combo'.

 <xsl:template name="postFieldException">
  <xsl:choose>

   <!-- Combo that is loaded on change of the ATOfAT element --> 
   <xsl:when test="@name='ATOFAC' and @shape='Combo'">
    <generateCombo>
     <event name="change" element="ATOfAT" getid="true"/>
     <requestname>ActTypGetAJAXCombo</requestname>
     <fill from="ATOfAT" to="TypeOfType"/>
     <return to="ATOFAC" getid="true"/>
    </generateCombo>
   </xsl:when>
  
   <!-- Combo that is loaded when the page apears and with an empty value --> 
   <xsl:when test="@name='Descr2' and @shape='Combo'">
    <generateCombo>
     <event name="direct"/>
     <requestname>MsgHGACDes</requestname>
     <fill fix="FooValue" to="FooField"/>
     <emptyValue>true</emptyValue>
     <return to="Descr2" getid="true"/>
    </generateCombo>
   </xsl:when>
 
  </xsl:choose>
 </xsl:template>

Image:Hint.png Hint: Don't forget the @shape='Combo' in the xsl:when statement. Otherwise you will get an JavaScript error if someone changes the shape of the field.

Description

Root-Element
<generateCombo>
Event and element that is observed for executing the request.
<event name="change" element="ATOfAT" getid="true"/>
name = Name of the event that is observed.
change = Combo is generated on change of element
click = Combo is generated on click of element
direct = Combo is generated diretly on load of the page no element is observed
element = Id or name (getid should be true) of the Element that is observed.
getid = If true the id of the element is generated by xslt
Name of the request the executeted to get the ComboBox values
 <requestname>ActTypGetAJAXCombo</requestname>
Request parameter
<fill from="ATOfAT" to="TypeOfType"/>
<fill fix="Foo" to="TypeOfType"/>
from = ID of the element that contains the request value
fix = constant request value
to = Name of the request parameter
Empty value
<emptyValue>true</emptyValue> 
An empty value is generated as first combo option
Return parameter for the ComboBox values.
<return to="ATOFAC" getid="true"/>
to = ID of the ComboBox element
getid = If true the id of the element is generated by xslt
Personal tools