OnClick-Handler

From Plex-XML
Jump to: navigation, search

onClick-Handler are special action-templates that could be executed in the onclick, onClickNewWindow, onClickRefresh templates.

Contents

Common Properties

<cancelBubble/>

Generates a "event.cancelBubble=true;". It stops the event subsequently call on every ancestor (containers of containers of etc.) of the DisplayObject that originally dispatched the event.

Useful e.g. for a link in a grid row with a GridRowOnClick.

<onclick>
 ...
 <cancelBubble/>
</onclick>

<progressWindow/>

Shows a modal loading window while the request is processed. Could be used for longer lasting requests.

Processing.png

<onclick>
 ...
 <progressWindow/>
</onclick>

Handler

url

Opens an URL in a new browser window.

Notice: There is also a request if you like to open a URL in a iFrame:

...request=OpenExternalLink&url=http://www.allabout.de

Example

<xsl:call-template name="onClickNewWindow">
 <xsl:with-param name="param">
  <url>
   <xsl:value-of select="$URLFoo"/>
  </url>
  <width>1300</width>
  <height>1000</height>
 </xsl:with-param>
</xsl:call-template>

javascript

Copies the javascript 1:1 before any other onclick action. You are able to put any other onclick element behind the javascript element.

Example

<toolbar>
 <button text="{$t_Foo}" alt="{$t_Foo}" image="foo.gif" id="fooButton">
  <onclick>
   <javascript>
    alert('Hi dude! This window will close soon...');
   </javascript>
   <close/>
  </onclick>
 </button>
</toolbar>

noaction

Example


close

Closes the current window and refreshes the grid below (if you have one) e.g. after an update. You don't have to worry about the type of window (ajax- or real browser window).

Example

<button text="{$t_Cancel}" type="button" image="close.gif" mainButton='false'>
 <onclick>
  <close/>
 </onclick>
</button>

selectRow

Example


checkboxaction

Action that is executed after a gridcheckbox click.

ajaxOptions: See http://prototypejs.org/api/ajax/request for reference

Example

<gridcheckbox name="chartselect" id="HCK_{$identcode}">
 <onclick>
  <checkboxaction>
   <formName>HCAddRemSel</formName>
   <param value="{$identcode}">HCID</param>
   <ajaxOptions>onSuccess: function() {console.log('ich war da');}</ajaxOptions>
  </checkboxaction>
  <javascript>
   alert('Hi, dude!');
  </javascript>
 </onclick>
</gridcheckbox>

ajaxPageLoad

Example

Execute an ajax request with the onClick event of a button.

<button type="largebutton" text="some text" alt="some text" image="message.gif">
 <onclick>
  <ajaxPageLoad>
   <xsl:attribute name="target">your_target_div</xsl:attribute>
   <xsl:attribute name="url"><xsl:value-of select='$vURL' /></xsl:attribute>
   <xsl:attribute name="pars">?request=FooRequest&style=ajax</xsl:attribute>
  </ajaxPageLoad>
 </onclick>
</button>
<button text="Forward curve" alt="Forward curve" image="chart.png">
 <onclick>
  <ajaxPageLoad style="ajax" target="your_taregt_div">
   <request>your_request</request>
   <param value="{$v_foo}">FooID</param>
  </ajaxPageLoad>
 </onclick>
</button>

submit

Example

A Button that submits a HTML form and displays the response in a special target. The target attribute is optional. By default the rsponse is displayed in the container where the button is.

<xsl:variable name="thisForm">FooUpdate</xsl:variable>
<button text="{$t_UpdateText}" alt="{$t_Update}" image="save.gif" id="saveButton" mainButton="true">
 <onclick>
  <submit>
   <formName><xsl:value-of select="$thisForm"/></formName>
   <action>U</action>
   <checked>true</checked>
   <target form="{$thisForm}"/>
  </submit>
 </onclick>
</button>

report

Example

Button that opens a new window with a report. The key attribute is a reference to the reporting framework.

 <button row="false" alt="{$t_fooTitleText}" text="{$t_fooTitleText}" image="view.gif">
  <onclick>
   <report key="fooKey" title="{$t_fooTitleText}" width="900" height="700">
    <parameter name="p_Company" value="{$company}" />
   </report>
  </onclick>
 </button>

otherwise

Example







				
				
Personal tools