All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.maven-faces-plugin.components.trinidad.html.HtmlScript.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="utf-8"?>
<!--
    Licensed to	the Apache Software Foundation (ASF) under one
    or more contributor	license	agreements.  See the NOTICE file
    distributed	with this work for additional information
    regarding copyright	ownership.  The	ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License");	you may	not use	this file except in compliance
    with the License.  You may obtain a	copy of	the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed	to in writing,
    software distributed under the License is distributed on an
    "AS	IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing	permissions and	limitations
    under the License.

-->
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
	      xmlns:trh="http://myfaces.apache.org/trinidad/html"
	      xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
              xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata">
  <component>
    <description><![CDATA[The script component supports	importing libraries, and inline	scripts.]]></description>
    <icon>
      <small-icon>/org/apache/myfaces/trinidadinternal/metadata/icons/script.gif</small-icon>
    </icon>
    <component-type>org.apache.myfaces.trinidad.HtmlScript</component-type>
    <component-class>org.apache.myfaces.trinidad.component.html.HtmlScript</component-class>
    <property>
      <description><![CDATA[the	inline script]]></description>
      <property-name>text</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
	<mfp:property-metadata/>
        <fmd:property-metadata>
          <fmd:preferred>true</fmd:preferred>
        </fmd:property-metadata>
      </property-extension>
    </property>
    <property>
      <description><![CDATA[the	URI of a script	library	to import.]]></description>
      <property-name>source</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
	<mfp:property-metadata/>
        <fmd:property-metadata>
          <fmd:preferred>true</fmd:preferred>
        </fmd:property-metadata>
      </property-extension>
    </property>
    <property>
      <description><![CDATA[if the script generates content
	    using document.write() or document.writeln(), set this to true.
	    It defaults	to false.]]>
      </description>
      <property-name>generatesContent</property-name>
      <property-class>boolean</property-class>
      <default-value>false</default-value>
    </property>
    <property>
      <description><![CDATA[the	IDs of the components that should trigger a partial update.
	 This component	will listen on the trigger components. If one of the
	 trigger components receives an	event that will	cause it to update
	 in some way, this component will request to be	updated	too.]]>
      </description>
      <property-name>partialTriggers</property-name>
      <property-class>java.lang.String[]</property-class>
      <property-extension>
        <mfp:mutable>rarely</mfp:mutable>
        <mfp:property-metadata>
          <mfp:multi-scoped-id-holder>true</mfp:multi-scoped-id-holder>
        </mfp:property-metadata>
      </property-extension>      
    </property>
    <component-extension>
      <mfp:component-family>org.apache.myfaces.trinidad.Script</mfp:component-family>
      <mfp:component-supertype>org.apache.myfaces.trinidad.ComponentBase</mfp:component-supertype>
      <mfp:renderer-type>org.apache.myfaces.trinidad.Script</mfp:renderer-type>
      <mfp:tag-name>trh:script</mfp:tag-name>
      <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.html.HtmlScriptTag</mfp:tag-class>
      <mfp:long-description><![CDATA[<html:p>
	    The	script component supports both the importing of	libraries and
	    inline scripts.
	  </html:p>]]>
      </mfp:long-description>
      <mfp:example>
	<mfp:source-description>Example	of a simple Javascript function	script.</mfp:source-description>
	<mfp:source-code>
	  <![CDATA[
<trh:script text="function doubleOrTriple()
{
  var p	= new TableProxy('table1');
  var c	= p.getFormElement('numbers', 0);
  var t	= (c.value - 0);
  if (t	&amp;lt; 10)
  { t *= 2 }
  else
  { t *= 3}
  p._form.newValueField.value =	t;
}"/>
	  ]]>
	</mfp:source-code>
      </mfp:example>
      <mfp:author>Adam Winer</mfp:author>
      <mfp:component-metadata/>
      <fmd:component-metadata>
        <fmd:default-property>source</fmd:default-property>
        <fmd:hidden>true</fmd:hidden>
      </fmd:component-metadata>
    </component-extension>
  </component>
</faces-config>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy