Author: lu4242 Date: Wed Jun 1 15:09:07 2011 New Revision: 1130179 URL: http://svn.apache.org/viewvc?rev=1130179&view=rev Log: TOMAHAWK-1593 Add s:jsCallbackFunction and s:jsOnEventAjax tags Added: myfaces/tomahawk/trunk/sandbox/examples20/src/main/java/org/apache/myfaces/examples/jsCallbackFunction/ myfaces/tomahawk/trunk/sandbox/examples20/src/main/java/org/apache/myfaces/examples/jsCallbackFunction/JsCallbackFunctionBean.java myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsCallbackFunction.xhtml myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsOnEventAjax.xhtml Modified: myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/META-INF/templates/leftmenu.xhtml myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/WEB-INF/examples-config.xml Added: myfaces/tomahawk/trunk/sandbox/examples20/src/main/java/org/apache/myfaces/examples/jsCallbackFunction/JsCallbackFunctionBean.java URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples20/src/main/java/org/apache/myfaces/examples/jsCallbackFunction/JsCallbackFunctionBean.java?rev=1130179&view=auto ============================================================================== --- myfaces/tomahawk/trunk/sandbox/examples20/src/main/java/org/apache/myfaces/examples/jsCallbackFunction/JsCallbackFunctionBean.java (added) +++ myfaces/tomahawk/trunk/sandbox/examples20/src/main/java/org/apache/myfaces/examples/jsCallbackFunction/JsCallbackFunctionBean.java Wed Jun 1 15:09:07 2011 @@ -0,0 +1,42 @@ +/* + * 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. + */ +package org.apache.myfaces.examples.jsCallbackFunction; + +import java.util.ArrayList; +import java.util.List; + +public class JsCallbackFunctionBean +{ + + private List items; + + public JsCallbackFunctionBean() + { + items = new ArrayList(); + items.add("A"); + items.add("B"); + items.add("C"); + } + + public List getItems() + { + return items; + } + +} Modified: myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/META-INF/templates/leftmenu.xhtml URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/META-INF/templates/leftmenu.xhtml?rev=1130179&r1=1130178&r2=1130179&view=diff ============================================================================== --- myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/META-INF/templates/leftmenu.xhtml (original) +++ myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/META-INF/templates/leftmenu.xhtml Wed Jun 1 15:09:07 2011 @@ -35,6 +35,8 @@
  • +
  • +
  • Modified: myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/WEB-INF/examples-config.xml URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/WEB-INF/examples-config.xml?rev=1130179&r1=1130178&r2=1130179&view=diff ============================================================================== --- myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/WEB-INF/examples-config.xml (original) +++ myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/WEB-INF/examples-config.xml Wed Jun 1 15:09:07 2011 @@ -27,6 +27,12 @@ org.apache.myfaces.examples.passwordStrength.PasswordStrengthBean request + + + jsCallbackFunctionBean + org.apache.myfaces.examples.jsCallbackFunction.JsCallbackFunctionBean + request + Added: myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsCallbackFunction.xhtml URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsCallbackFunction.xhtml?rev=1130179&view=auto ============================================================================== --- myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsCallbackFunction.xhtml (added) +++ myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsCallbackFunction.xhtml Wed Jun 1 15:09:07 2011 @@ -0,0 +1,78 @@ + + + + + + + + + + +

    This example uses s:jsCallbackFunction to render a inline function that fade the image using f:ajax 'onevent' property. +

    +

    The typical use case is how to hook f:ajax 'onevent' with a function callback. The param 'e' knows the source + of the ajax operation, but doesn't know the target of further operations. In this case, s:effectFade forId="panel" is + used to indicate that a fade operation is required to be applied on the panel with the image. +

    +

    To generate the event name there are two options:

    +
      +
    • mc:findComponentFrom(component,'someId').functionName
    • +
    • s:jsCallbackFunctionName(component,'someId')
    • +
    +
    + + +

    Panel #{item}

    +

    The generated function name is :

    +
    + + + +
    + + + + + + + + + + + + + +
    +
    +
    +
    + + \ No newline at end of file Added: myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsOnEventAjax.xhtml URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsOnEventAjax.xhtml?rev=1130179&view=auto ============================================================================== --- myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsOnEventAjax.xhtml (added) +++ myfaces/tomahawk/trunk/sandbox/examples20/src/main/webapp/jsOnEventAjax.xhtml Wed Jun 1 15:09:07 2011 @@ -0,0 +1,78 @@ + + + + + + + + + + +

    This example uses s:onEventAjax to render a inline function that fade the image using f:ajax 'onevent' property. + This is a variant of s:jsCallbackFunction to make easier write this specific callback +

    +

    The typical use case is how to hook f:ajax 'onevent' with a function callback. The param 'e' knows the source + of the ajax operation, but doesn't know the target of further operations. In this case, s:effectFade forId="panel" is + used to indicate that a fade operation is required to be applied on the panel with the image. +

    +

    To generate the event name there are two options:

    +
      +
    • mc:findComponentFrom(component,'someId').functionName
    • +
    • s:jsCallbackFunctionName(component,'someId')
    • +
    +
    + + +

    Panel #{item}

    +

    The generated function name is :

    +
    + + + +
    + + + + + + + + + + + + +
    +
    +
    +
    + + \ No newline at end of file