RichFaces3 ShowCaseのSimpleTogglePanelを実行します。
【手順】
1.「RichFaces3プロジェクトの作成方法」の手順で、「RichFaces3Sample005-SimpleTogglePanel」といプロジェクトを作成。
※プロジェクトの設定は以下の通り。
2.「WebContent/WEB-INF/web.xml」を以下の様に入力。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>RichFaces3Sample005-SimpleTogglePanel</display-name>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
</web-app>
3.「Ctrl+Shift+F」を押し、ソースコードをフォーマッティング、「Ctrl+S」でファイルを保存。
4.「WebContent/WEB-INF/faces-config.xml」を以下の様に入力。
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
</faces-config>
5.「Ctrl+Shift+F」を押し、ソースコードをフォーマッティング、「Ctrl+S」でファイルを保存。
6.「任意のファイルの作成方法」の手順で、「WebContent/」ディレクトリに「index.xhtml」というファイルを作成。
7.「index.xhtml」を以下の様に入力。
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<head>
</head>
<body>
<rich:simpleTogglePanel switchType="client" label="ヘッダー">
シンプルトグルパネル1の中身
</rich:simpleTogglePanel>
</body>
</html>
8.「Ctrl+Shift+F」を押し、ソースコードをフォーマッティング、「Ctrl+S」でファイルを保存。
9.「動的Webアプリケーションをサーバーに配置する方法」の手順で、作成したプロジェクトをサーバーに配置します。
10.「サーバーをデバッグモードで起動する方法」の手順で、サーバーを起動します。
11.ブラウザで以下のURLにアクセスします。
http://localhost:8080/RichFaces3Sample005-SimpleTogglePanel/faces/index.xhtml
12.以下の様に表示されれば成功です。
13.以下の様なHTMLが出力されました。
<html xmlns="http://www.w3c.org/1999/xhtml">
<head>
<link class="component" href="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__;jsessionid=F48537009330E557AD27CB290A3AE06F" rel="stylesheet" type="text/css" />
<link class="component" href="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__;jsessionid=F48537009330E557AD27CB290A3AE06F" media="rich-extended-skinning" rel="stylesheet" type="text/css" />
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript">
</script>
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript" type="text/javascript">
</script>
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.ImageCacheScript" type="text/javascript">
</script>
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalorg/ajax4jsf/javascript/scripts/form.js" type="text/javascript">
</script>
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/browser_info.js" type="text/javascript">
</script>
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalscripts/simpleTogglePanel.js" type="text/javascript">
</script>
<link class="component" href="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/s/3_3_3.Finalcss/simpleTogglePanel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__;jsessionid=F48537009330E557AD27CB290A3AE06F" rel="stylesheet" type="text/css" />
<script type="text/javascript">
window.RICH_FACES_EXTENDED_SKINNING_ON=true;
</script>
<script src="/RichFaces3Sample005-SimpleTogglePanel/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript">
</script>
</head>
<body>
<div class="rich-stglpanel " id="j_id1">
<script type="text/javascript">
SimpleTogglePanelManager.add(new SimpleTogglePanel("j_id1",
"true",{onexpand: '',oncollapse: ''}
));
</script>
<form id="j_id1:_form" name="j_id1:_form" method="post" style="margin:0; padding:0; display: inline;" action="/RichFaces3Sample005-SimpleTogglePanel/faces/index.xhtml;jsessionid=F48537009330E557AD27CB290A3AE06F">
<div class="rich-stglpanel-header " id="j_id1_header" onclick="SimpleTogglePanelManager.toggleOnClient(event,'j_id1');">
<div class="rich-stglpanel-marker">
<div class="rich-stglpnl-marker" id="j_id1_switch_on">
«
</div>
<div class="rich-stglpnl-marker" id="j_id1_switch_off" style="display: none">
»
</div>
</div>
ヘッダー
</div>
<div style="display: none;">
<input autocomplete="off" id="j_id1_input" name="j_id1" type="hidden" value="true" />
</div>
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id1" autocomplete="off" />
</form>
<div class="rich-stglpanel-body " id="j_id1_body">
シンプルトグルパネル1の中身
</div>
</div>
</body>
</html>
以上です。
SimpleTogglePane-01.jpg)
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。