Jsf-display-datatable
JSF-DataTableの表示
h:dataTableタグは、表形式でデータを表示するために使用されます。
JSFタグ
レンダリングされた出力
タグ属性
S.No | Attribute & Description |
---|---|
1 |
id コンポーネントの識別子 |
2 |
rendered ブール値。 falseはレンダリングを抑制します |
3 |
dir テキストの方向。 有効な値は ltr (左から右)および rtl (右から左)です。 |
4 |
styleClass カスケードスタイルシート(CSS)クラス名 |
5 |
value コンポーネントの値、通常は値バインディング |
6 |
bgcolor テーブルの背景色 |
7 |
border テーブルの境界線の幅 |
8 |
cellpadding テーブルセルの周りのパディング |
9 |
cellspacing テーブルセル間の間隔 |
10 |
columnClasses 列のCSSクラスのカンマ区切りリスト |
11 |
first 表に示されている最初の行のインデックス |
12 |
footerClass テーブルフッターのCSSクラス |
13 |
frame テーブルを囲むフレームの側面の仕様を描画する必要があります。有効な値:none、above、below、hsides、vsides、lhs、rhs、box、border |
14 |
headerClass テーブルヘッダーのCSSクラス |
15 |
rowClasses 行のCSSクラスのカンマ区切りリスト |
16 |
rules セル間に描画される線の仕様。有効な値:グループ、行、列、すべて |
17 |
summary 音声などの非視覚的フィードバックに使用されるテーブルの目的と構造の概要 |
18 |
var 値の現在のアイテムを表すデータテーブルによって作成された変数の名前 |
19 |
title アクセシビリティのために使用される、要素を説明するタイトル。 視覚的なブラウザは通常、タイトルの価値に関するツールチップを作成します |
20 |
width 要素の幅 |
21 |
onblur 要素がフォーカスを失います |
22 |
onchange 要素の価値の変化 |
23 |
onclick マウスボタンが要素上でクリックされた |
24 |
ondblclick マウスボタンが要素上でダブルクリックされます |
25 |
onfocus 要素がフォーカスを受け取る |
26 |
onkeydown キーが押された |
27 |
onkeypress キーが押され、その後解放されます |
28 |
onkeyup キーが解放されます |
29 |
onmousedown マウスボタンが要素上で押されています |
30 |
onmousemove マウスが要素の上を移動する |
31 |
onmouseout マウスは要素の領域を離れます |
32 |
onmouseover マウスが要素の上に移動する |
33 |
onmouseup マウスボタンが離された |
応用例
上記のタグをテストするテストJSFアプリケーションを作成しましょう。
Step | Description |
---|---|
1 | Create a project with a name helloworld under a package com.finddevguides.test as explained in the JSF - h:outputStylesheet sub-chapter of JSF - Basic Tags chapter. |
2 | Modify styles.css as explained below. |
3 | Create Employee.java under package com.finddevguides.test as explained below. |
4 | Create UserData.java as a managed bean under package com.finddevguides.test as explained below. |
5 | Modify home.xhtml as explained below. Keep the rest of the files unchanged. |
6 | Compile and run the application to make sure the business logic is working as per the requirements. |
7 | Finally, build the application in the form of war file and deploy it in Apache Tomcat Webserver. |
8 | Launch your web application using appropriate URL as explained below in the last step. |
styles.css
Employee.java
UserData.java
home.xhtml
すべての変更を完了したら、JSF-最初のアプリケーションの章で行ったようにアプリケーションをコンパイルして実行します。 すべてがアプリケーションで問題ない場合、次の結果が生成されます。