Permalink
Browse files

https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-613

Added h:commandScript
  • Loading branch information...
BalusC committed May 27, 2016
1 parent a8b263b commit 26d852d26ce088e29eb414cb892263ac62278c42
View
@@ -1,5 +1,6 @@
*.class
*.jar
*.jsfdia
target/
/bin/
/dist/
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
https://glassfish.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.
When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.
GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.
Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"
Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.
-->
<!-- ========== Command+Script Properties ================================== -->
<!-- template
<property>
<description>
</description>
<display-name></display-name>
<icon></icon>
<property-name></property-name>
<property-class>java.lang.String</property-class>
</property>
-->
<root>
<property>
<description><![CDATA[
Name of JavaScript function to be declared, e.g. <code>name="functionName"</code>.
This can be a namespaced function name, e.g. <code>name="ez.functionName"</code>.
]]></description>
<icon></icon>
<property-name>name</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description><![CDATA[
Whether to execute declared JavaScript function during <code>load</code> event of the <code>window</code>.
Defaults to <code>false</code>.
]]></description>
<icon></icon>
<property-name>autorun</property-name>
<property-class>boolean</property-class>
</property>
<property>
<description><![CDATA[
This is a space separated list of client identifiers of components
that will participate in the "execute" portion of the Request Processing Lifecycle.
If a literal is specified the identifiers must be space delimited.
Any of the keywords "@this", "@form", "@all", "@none" may be specified in the identifier list.
If not specified, the default value of "@this" is assumed.
For example, <code>@this clientIdOne clientIdTwo</code>.
]]></description>
<icon></icon>
<property-name>execute</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description><![CDATA[
This is a space separated list of client identifiers of components
that will participate in the "render" portion of the Request Processing Lifecycle.
If a literal is specified the identifiers must be space delimited.
Any of the keywords "@this", "@form", "@all", "@none" may be specified in the identifier list.
If not specified, the default value of "@none" is assumed.
For example, <code>@this clientIdOne clientIdTwo</code>.
]]></description>
<icon></icon>
<property-name>render</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description><![CDATA[
Reset specific input values.
Interpret the value of the <code>render</code> attribute as a space separated list of client identifiers
suitable for passing directly to <code>UIViewRoot.resetValues()</code>.
The implementation must cause an <code>ActionListener</code> to be attached to the <code>ActionSource</code>
component in which this tag is nested that calls <code>UIViewRoot.resetValues()</code> passing the value
of the <code>render</code> attribute as the argument.
]]></description>
<icon></icon>
<property-name>resetValues</property-name>
<property-class>java.lang.Boolean</property-class>
</property>
<property>
<description>
The name of the JavaScript function that will handle UI events.
</description>
<icon></icon>
<property-name>onevent</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description>
The name of the JavaScript function that will handle errors.
</description>
<icon></icon>
<property-name>onerror</property-name>
<property-class>java.lang.String</property-class>
</property>
</root>
@@ -416,6 +416,28 @@
</component>
<component>
<description>
<![CDATA[<p>Represents an HTML <code>script</code> element for a function that acts
like an ajax form submit. This component must be placed inside
a form, and requires JavaScript to be enabled in the client.</p>]]>
</description>
<display-name>Command Script</display-name>
<component-type>javax.faces.HtmlCommandScript</component-type>
<component-class>javax.faces.component.html.HtmlCommandScript</component-class>
<xi:include href="uicomponent-props.xml" xpointer="xpointer(/root/*)"/>
<xi:include href="actionsource-props.xml" xpointer="xpointer(/root/*)"/>
<xi:include href="command-script-props.xml" xpointer="xpointer(/root/*)"/>
<component-extension>
<base-component-type>javax.faces.Command</base-component-type>
<renderer-type>javax.faces.Script</renderer-type>
</component-extension>
</component>
<component>
<description>
@@ -1640,6 +1662,57 @@
</renderer>
<renderer>
<description>
<![CDATA[
<p class="changed_added_2_3">
Render a JavaScript function that invokes <code>jsf.ajax.request()</code> function.
</p>
<h3>Encode Behavior</h3>
<p>
Render an HTML <code>script</code> element. If the value of the "name" attribute does not contain a
period <code>.</code> indicating a namespaced function name, then render JavaScript <code>var</code>
keyword, followed by a space character. Render the value of the "name" attribute, followed by
JavaScript assignment operator. Render JavaScript function which invokes <code>jsf.ajax.request()</code>
with data provided by <code>execute</code>, <code>render</code>, <code>onbegin</code>,
<code>oncomplete</code>, <code>onsuccess</code> and <code>onerror</code> arguments, if any.
</p>
<p>
If the component being rendered has any <code>UIParameter</code> children, each one of them must be
encoded into <code>params</code> object of the <code>options</code> object of the <code>jsf.ajax.request()</code>
function.
</p>
<p>
If the rendered JavaScript function is invoked with an object argument, each property must be
encoded into <code>params</code> object of the <code>options</code> object of the <code>jsf.ajax.request()</code>
function. This will override any property with the same key.
</p>
<h3>Decode Behavior</h3>
<p>
Obtain the <code>Map</code> from the "requestParameterMap" property of the <code>ExternalContext</code>.
If the value in the <code>Map</code> for the value of the "javax.faces.source" equals to the "clientId" property of the component,
create a <code>javax.faces.event.ActionEvent</code> around the component, and pass it to the <code>queueEvent()</code> method of the component,
which must be an instance of <code>UICommand</code>.
</p>
]]>
</description>
<component-family>javax.faces.Command</component-family>
<renderer-type>javax.faces.Script</renderer-type>
<renderer-class>
<xi:include href="standard-html-renderkit-impl.xml" xpointer="xpointer(/root/command-script-renderer-class/text())"/>
</renderer-class>
<xi:include href="command-script-attrs.xml" xpointer="xpointer(/root/*)"/>
<renderer-extension>
<renders-children>false</renders-children>
</renderer-extension>
</renderer>
<renderer>
<description>
Oops, something went wrong.

0 comments on commit 26d852d

Please sign in to comment.