You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/04/13 23:44:57 UTC
svn commit: r933793 -
/myfaces/current20/test-webapp/webapp/src/main/webapp/ajax5jsp.jsp
Author: lu4242
Date: Tue Apr 13 21:44:56 2010
New Revision: 933793
URL: http://svn.apache.org/viewvc?rev=933793&view=rev
Log:
add ajax jsp sample
Added:
myfaces/current20/test-webapp/webapp/src/main/webapp/ajax5jsp.jsp
Added: myfaces/current20/test-webapp/webapp/src/main/webapp/ajax5jsp.jsp
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/ajax5jsp.jsp?rev=933793&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/ajax5jsp.jsp (added)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/ajax5jsp.jsp Tue Apr 13 21:44:56 2010
@@ -0,0 +1,25 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<html>
+ <head>
+ <title>Hello World</title>
+ <script type="text/javascript" src="/test-webapp/javax.faces.resource/jsf.js.jsf?ln=javax.faces"></script>
+ </head>
+ <body>
+ <f:view>
+ <h:form id="mainForm">
+ <p>JSP Ajax Example...</p>
+ <h:panelGrid columns="2">
+ <h:outputLabel for="outname" value="Name: " />
+ <h:outputText id="outname" value="#{helloWorld.name}"/>
+ <h:outputLabel for="inname" value="Please enter your name" />
+ <h:inputText id="inname" value="#{helloWorld.name}"/>
+ <h:commandButton type="button" value="Ajax Update"
+ onclick="jsf.ajax.request(this, event, {execute:'mainForm',render: 'mainForm:outname'}); return false;"/>
+ <h:commandButton value="Normal Submit"/>
+ <h:messages showDetail="true" showSummary="false"/>
+ </h:panelGrid>
+ </h:form>
+ </f:view>
+ </body>
+</html>