You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/07/15 18:24:08 UTC

svn commit: r422260 - in /myfaces: core/trunk/impl/src/main/java/org/apache/myfaces/el/ shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/ shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ tomahawk/tr...

Author: mmarinschek
Date: Sat Jul 15 09:24:06 2006
New Revision: 422260

URL: http://svn.apache.org/viewvc?rev=422260&view=rev
Log:
adding an example for the sandbox form, making RI and tomahawk links, forms and buttons compatible (well, it wasn't as easy as it seemed...)

Added:
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/focus/
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources/org/apache/myfaces/custom/focus/resource/
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/form/
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/form/FormBean.java
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/form.jsp
Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/PropertyResolverImpl.java Sat Jul 15 09:24:06 2006
@@ -407,6 +407,7 @@
         }
         catch (Throwable t)
         {
+            log.debug("Exception while invoking setter method.",t);
             throw new EvaluationException(getMessage(base, name, newValue, m), t);
         }
     }

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java Sat Jul 15 09:24:06 2006
@@ -133,6 +133,9 @@
         }
 
         writer.endElement(HTML.INPUT_ELEM);
+
+        HtmlFormRendererBase.renderScrollHiddenInputIfNecessary(
+                findNestingForm(uiComponent, facesContext).getForm(),facesContext,writer);
     }
 
 
@@ -183,8 +186,8 @@
             onClick.append(';');
         }
 
-        //call the clear_<formName> method
-        onClick.append(HtmlRendererUtils.getClearHiddenCommandFormParamsFunctionName(formName)).append("();");
+        //call the script to clear the form (clearFormHiddenParams_<formName>) method
+        onClick.append(HtmlRendererUtils.getClearHiddenCommandFormParamsFunctionName(formName)).append("('").append(formName).append("');");
 
         if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
         {
@@ -202,7 +205,7 @@
 	{
 		if (nestingForm != null)
         {
-            HtmlFormRendererBase.addHiddenCommandParameter(nestingForm, hiddenFieldName);
+            HtmlFormRendererBase.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
         }
 	}
 

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java Sat Jul 15 09:24:06 2006
@@ -16,15 +16,14 @@
 package org.apache.myfaces.shared.renderkit.html;
 
 import org.apache.myfaces.shared.config.MyfacesConfig;
-import org.apache.myfaces.shared.renderkit.html.HTML;
 
+import javax.faces.FacesException;
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIForm;
 import javax.faces.component.html.HtmlForm;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
-import javax.faces.FacesException;
 import java.io.IOException;
 import java.util.HashSet;
 import java.util.Map;
@@ -48,7 +47,27 @@
             = UIForm.class.getName() + ".org.apache.myfaces.HIDDEN_COMMAND_INPUTS_SET";
 
     private static final String VALIDATE_CONTEXT_PARAM = "org.apache.myfaces.VALIDATE";
+    private static final String SCROLL_HIDDEN_INPUT = "org.apache.myfaces.SCROLL_HIDDEN_INPUT";
 
+    /**
+     * Okay, we're going far for compatibility here, but well, we ought to.
+     * this is the parameter that is set with the form id in the RI
+     * if you don't set this parameter, buttons in the RI 1.1. won't work with your form
+     * failing with a javascript error.
+     *
+     * nice, eh?
+     *
+     * fixed in the RI in 1.2
+     *
+     * if you want to know more, search for this comment in the 1.1. RI sources:
+     *
+     * // look up the clientId of the form in request scope to arrive the name of
+     *  // the javascript function to invoke from the onclick event handler.
+     *  // PENDING (visvan) we need to fix this dependency between the renderers.
+     *  // This solution is only temporary.
+     *
+     */
+    private static final String FORM_CLIENT_ID_ATTR = "com.sun.faces.FORM_CLIENT_ID_ATTR";
 
 
     public void encodeBegin(FacesContext facesContext, UIComponent component)
@@ -56,6 +75,11 @@
     {
         org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, component, UIForm.class);
 
+        // see comment for FORM_CLIENT_ID_ATTR above - this is entirely for compatibility with RI in version 1.1
+        //todo: move out for 1.2!
+        facesContext.getExternalContext().getRequestMap().put(FORM_CLIENT_ID_ATTR,
+                component.getClientId(facesContext));
+
         if("true".equals(facesContext.getExternalContext().getInitParameter(VALIDATE_CONTEXT_PARAM)))
         {
             UIComponent parent = component.getParent();
@@ -127,10 +151,7 @@
         writer.writeAttribute(HTML.VALUE_ATTR, HIDDEN_SUBMIT_INPUT_VALUE, null);
         writer.endElement(HTML.INPUT_ELEM);
 
-        if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
-        {
-            org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils.renderAutoScrollHiddenInput(facesContext,writer);
-        }
+        renderScrollHiddenInputIfNecessary(component, facesContext, writer);
 
         if(!facesContext.getApplication().getStateManager().isSavingStateInClient(facesContext))
         {
@@ -142,7 +163,8 @@
         }
 
         //render hidden command inputs
-        Set set = (Set)component.getAttributes().get(HIDDEN_COMMAND_INPUTS_SET_ATTR);
+        Set set = (Set)facesContext.getExternalContext().getRequestMap().get(
+                getHiddenCommandInputsSetName(facesContext,component));
         if (set != null && !set.isEmpty())
         {
             HtmlRendererUtils.renderHiddenCommandFormParams(writer, set);
@@ -172,6 +194,24 @@
         writer.endElement(HTML.FORM_ELEM);
     }
 
+    private static String getHiddenCommandInputsSetName(FacesContext facesContext, UIComponent form)
+    {
+        StringBuffer buf = new StringBuffer();
+        buf.append(HIDDEN_COMMAND_INPUTS_SET_ATTR);
+        buf.append("_");
+        buf.append(form.getClientId(facesContext));
+        return buf.toString();
+    }
+
+    private static String getScrollHiddenInputName(FacesContext facesContext, UIComponent form)
+    {
+        StringBuffer buf = new StringBuffer();
+        buf.append(SCROLL_HIDDEN_INPUT);
+        buf.append("_");
+        buf.append(form.getClientId(facesContext));
+        return buf.toString();
+    }
+
 
     public void decode(FacesContext facesContext, UIComponent component)
     {
@@ -200,15 +240,33 @@
     }
 
 
-    public static void addHiddenCommandParameter(UIComponent form, String paramName)
+    public static void addHiddenCommandParameter(FacesContext facesContext, UIComponent form, String paramName)
     {
-        Set set = (Set)form.getAttributes().get(HIDDEN_COMMAND_INPUTS_SET_ATTR);
+        Set set = (Set) facesContext.getExternalContext().getRequestMap().get(getHiddenCommandInputsSetName(facesContext,form));
         if (set == null)
         {
             set = new HashSet();
-            form.getAttributes().put(HIDDEN_COMMAND_INPUTS_SET_ATTR, set);
+            facesContext.getExternalContext().getRequestMap().put(getHiddenCommandInputsSetName(facesContext,form), set);
         }
         set.add(paramName);
+    }
+
+    public static void renderScrollHiddenInputIfNecessary(UIComponent form, FacesContext facesContext, ResponseWriter writer)
+            throws IOException
+    {
+        if(form == null)
+        {
+            return;
+        }
+
+        if(facesContext.getExternalContext().getRequestMap().get(getScrollHiddenInputName(facesContext,form))==null)
+        {
+            if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
+            {
+                org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils.renderAutoScrollHiddenInput(facesContext,writer);
+            }
+            facesContext.getExternalContext().getRequestMap().put(getScrollHiddenInputName(facesContext,form),Boolean.TRUE);
+        }
     }
 
     /**

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java Sat Jul 15 09:24:06 2006
@@ -24,7 +24,6 @@
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UICommand;
 import javax.faces.component.UIComponent;
-import javax.faces.component.UIForm;
 import javax.faces.component.UIOutput;
 import javax.faces.component.UIParameter;
 import javax.faces.component.html.HtmlCommandLink;
@@ -149,6 +148,9 @@
         if (component instanceof UICommand)
         {
                 renderCommandLinkEnd(facesContext, component);
+
+                HtmlFormRendererBase.renderScrollHiddenInputIfNecessary(
+                        findNestingForm(component,facesContext).getForm(),facesContext,facesContext.getResponseWriter());
         }
         else if (component instanceof UIOutput)
         {
@@ -234,8 +236,8 @@
             onClick.append(';');
         }
 
-        //call the clear_<formName> method
-        onClick.append(HtmlRendererUtils.getClearHiddenCommandFormParamsFunctionName(formName)).append("();");
+        //call the script to clear the form (clearFormHiddenParams_<formName>) method
+        onClick.append(HtmlRendererUtils.getClearHiddenCommandFormParamsFunctionName(formName)).append("('").append(formName).append("');");
 
         String jsForm = "document.forms['" + formName + "']";
 
@@ -306,7 +308,7 @@
 	{
 		if (nestingForm != null)
         {
-            HtmlFormRendererBase.addHiddenCommandParameter(nestingForm, hiddenFieldName);
+            HtmlFormRendererBase.addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
         }
 	}
 

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java Sat Jul 15 09:24:06 2006
@@ -15,9 +15,14 @@
  */
 package org.apache.myfaces.shared.renderkit.html;
 
-import java.io.IOException;
-import java.util.*;
-import java.text.DecimalFormat;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.shared.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.shared.component.EscapeCapable;
+import org.apache.myfaces.shared.renderkit.JSFAttr;
+import org.apache.myfaces.shared.renderkit.RendererUtils;
+import org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder;
+import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
 
 import javax.faces.FacesException;
 import javax.faces.component.*;
@@ -26,16 +31,8 @@
 import javax.faces.convert.Converter;
 import javax.faces.model.SelectItem;
 import javax.faces.model.SelectItemGroup;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.JSFAttr;
-import org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
-import org.apache.myfaces.shared.renderkit.html.HTML;
-import org.apache.myfaces.shared.component.DisplayValueOnlyCapable;
-import org.apache.myfaces.shared.component.EscapeCapable;
+import java.io.IOException;
+import java.util.*;
 
 /**
  * @author Manfred Geiler (latest modification by $Author$)
@@ -48,7 +45,10 @@
     private static final String LINE_SEPARATOR = System.getProperty(
             "line.separator", "\r\n");
 
-    public static final String HIDDEN_COMMANDLINK_FIELD_NAME = "_link_hidden_";
+    public static final String HIDDEN_COMMANDLINK_FIELD_NAME = "_idcl";
+
+    public static final String CLEAR_HIDDEN_FIELD_FN_NAME =
+         "clearFormHiddenParams";
 
     private HtmlRendererUtils() {
         // utility class, do not instantiate
@@ -415,7 +415,7 @@
                                           HTML.DISABLED_ATTR, null);
                 }
 
-                String labelClass = null;
+                String labelClass;
                 boolean componentDisabled = isTrue(component.getAttributes().get("disabled"));
 
                 if (componentDisabled || disabled) {
@@ -862,7 +862,7 @@
      * Render the javascript function that is called on a click on a commandLink
      * to clear the hidden inputs. This is necessary because on a browser back,
      * each hidden input still has it's old value (browser cache!) and therefore
-     * a new submit would cause the according action once more!
+     * a new submit would fire the according action once more!
      *
      * @param writer
      * @param formName
@@ -878,15 +878,17 @@
         writer.startElement(HTML.SCRIPT_ELEM, null);
         writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
 
-        // Using writeComment instead of write with <!-- tag
         StringBuffer script = new StringBuffer();
         script.append("function ");
         script.append(functionName);
-        script.append("() {");
+        //the parameter in the following parameter list is added for compatibility to the RI
+        //of course, it isn't necessary - the current form is defined
+        //already by the formName passed as a parameter to this function, and included in the name of the function
+        script.append("(currFormName) {");
         if (dummyFormParams != null) {
-            script.append("\n  var f = document.forms['");
-            script.append(formName);
-            script.append("'];");
+            script.append("\n  var f = document.forms[");
+            script.append("'").append(formName).append("'");
+            script.append("];");
             for (Iterator it = dummyFormParams.iterator(); it.hasNext();) {
                 script.append("\n  f.elements['");
                 script.append((String) it.next());
@@ -907,8 +909,8 @@
         }
         script.append("\n}");
 
-        //Just to be sure we call this clear method on each load.
-        //Otherwise in the case, that someone submits a form by pressing Enter
+        //To be sure, we call this clear method on each load.
+        //If we don't do this and someone submits a form by pressing Enter
         //within a text input, the hidden inputs won't be cleared!
         script.append("\n");
         script.append(functionName);
@@ -919,15 +921,17 @@
     }
 
     /**
-     * Prefixes the given String with "clear_" and removes special characters
+     * Prefixes the given String with CLEAR_HIDDEN_FIELD_FN_NAME and removes special characters
      *
      * @param formName
      * @return String
      */
     public static String getClearHiddenCommandFormParamsFunctionName(
             String formName) {
-        return "clear_"
-               + JavascriptUtils.getValidJavascriptName(formName, false);
+        return JavascriptUtils.getValidJavascriptNameAsInRI(CLEAR_HIDDEN_FIELD_FN_NAME
+                                             + "_"
+                                             + formName
+                    .replace(NamingContainer.SEPARATOR_CHAR, '_'));
     }
 
     /**
@@ -1049,6 +1053,7 @@
 
     public static String[] getSupportedContentTypes()
     {
+        //noinspection UnnecessaryLocalVariable
         String[] supportedContentTypeArray = new String[]{HTML_CONTENT_TYPE,ANY_CONTENT_TYPE,
                                                           XHTML_CONTENT_TYPE,APPLICATION_XML_CONTENT_TYPE,TEXT_XML_CONTENT_TYPE};
         return supportedContentTypeArray;

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java Sat Jul 15 09:24:06 2006
@@ -113,6 +113,14 @@
             "with"
         }));
 
+    /**Don't use this function - except when compatibility with the RI is a must,
+     * as in the name for the clear form parameters script.
+     */
+    public static String getValidJavascriptNameAsInRI(String origIdentifier)
+    {
+        return origIdentifier.replaceAll("-", "$_");
+    }
+
     public static String getValidJavascriptName(String s, boolean checkForReservedWord)
     {
         if (checkForReservedWord && RESERVED_WORDS.contains(s))

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/navmenu/jscookmenu/HtmlJSCookMenuRenderer.java Sat Jul 15 09:24:06 2006
@@ -171,7 +171,7 @@
                 formName = DummyFormUtils.getDummyFormName();
             }
             else {
-                HtmlFormRendererBase.addHiddenCommandParameter(parentForm,JSCOOK_ACTION_PARAM);
+                HtmlFormRendererBase.addHiddenCommandParameter(context,parentForm,JSCOOK_ACTION_PARAM);
             }
 
             String myId = getMenuId(context, component);

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/form/FormBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/form/FormBean.java?rev=422260&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/form/FormBean.java (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/form/FormBean.java Sat Jul 15 09:24:06 2006
@@ -0,0 +1,20 @@
+package org.apache.myfaces.examples.form;
+
+/**
+ * @author Martin Marinschek
+ */
+public class FormBean
+{
+    public FormBean()
+    {
+        super();
+        System.out.println("Initialize formBean");
+    }
+
+    public String testAction()
+    {
+        System.out.println("test");
+        
+        return null;
+    }
+}

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?rev=422260&r1=422259&r2=422260&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Sat Jul 15 09:24:06 2006
@@ -37,6 +37,14 @@
         <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
 
+    <!-- managed bean for form-->
+
+    <managed-bean>
+        <managed-bean-name>formBean</managed-bean-name>
+        <managed-bean-class>org.apache.myfaces.examples.form.FormBean</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+    </managed-bean>
+
     <!-- managed bean for autoUpdateDataTable-->
 
     <managed-bean>

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/form.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/form.jsp?rev=422260&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/form.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/form.jsp Sat Jul 15 09:24:06 2006
@@ -0,0 +1,62 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
+
+<!--
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+//-->
+<html>
+
+	<%@include file="inc/head.inc" %>
+
+<body>
+  	<f:view>
+		<h:form id="formTest">
+            <h:panelGrid columns="2">
+                <h:outputLabel for="input1" value="Input1: "/>
+                <h:inputText id="input1"/>
+                <h:outputLabel for="input2" value="Input2: "/>
+                <h:inputText id="input2"/>
+                <h:outputLabel for="input3" value="Input3: "/>
+                <h:inputText id="input3"/>
+                <h:commandLink value="test1" action="#{formBean.testAction}"/>
+                <t:commandLink value="test2" action="#{formBean.testAction}"/>
+                <h:commandButton value="test1" action="#{formBean.testAction}"/>
+                <t:commandButton value="test2" action="#{formBean.testAction}"/>
+            </h:panelGrid>
+        </h:form>
+        <s:form id="formtest2">
+            <h:panelGrid columns="2">
+                <h:outputLabel for="input1" value="Input1: "/>
+                <h:inputText id="input1"/>
+                <h:outputLabel for="input2" value="Input2: "/>
+                <h:inputText id="input2"/>
+                <h:outputLabel for="input3" value="Input3: "/>
+                <h:inputText id="input3"/>
+                <h:commandLink value="test1" action="#{formBean.testAction}"/>
+                <t:commandLink value="test2" action="#{formBean.testAction}"/>
+                <h:commandButton value="test1" action="#{formBean.testAction}"/>
+                <t:commandButton value="test2" action="#{formBean.testAction}"/>
+            </h:panelGrid>
+        </s:form>
+      </f:view>
+</body>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</html>
\ No newline at end of file