Home > Java > Teedaでcolspanする

Teedaでcolspanする

Teedaでcolspanするにはダイナミックプロパティを利用すればできます。

colspan.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:te="http://www.seasar.org/teeda/extension" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Teedaでcolspan</title>
</head>
<body>

<form id="Form">
<table border="1">
	<tr>
		<th>OS名</th>
		<th id="versionColspan" colspan="1">バージョン</th>
	</tr>
	<tr>
		<td><span id="osName">dummy</span></td>
		<div id="versionItems">
		<td><span id="codeName">dummy</span><br /><span id="number">dummy</span></td>
		</div>
	</tr>
</table>
</form>

</body>
</html>

ColspanPage.java

package org.sample.web.fnc;

import java.util.ArrayList;
import java.util.List;

public class ColspanPage {

	public int versionColspan;

	public List<VersionDto> versionItems;
	public String codeName;
	public String number;

	public String osName;

	public Class<?> initialize() {
		return null;
	}

	public Class<?> prerender() {
		osName = "Mac";

		// Macのバージョン
		versionItems = new ArrayList<ColspanPage.VersionDto>();

		VersionDto mac1 = new VersionDto();
		mac1.number = "10.3";
		mac1.codeName = "Panther";
		versionItems.add(mac1);

		VersionDto mac2 = new VersionDto();
		mac2.number = "10.4";
		mac2.codeName = "Tiger";
		versionItems.add(mac2);

		VersionDto mac3 = new VersionDto();
		mac3.number = "10.5";
		mac3.codeName = "Leopard";
		versionItems.add(mac3);

		VersionDto mac4 = new VersionDto();
		mac4.number = "10.6";
		mac4.codeName = "SnowLeopard";
		versionItems.add(mac4);

		return null;
	}

	class VersionDto {
		public String codeName;
		public String number;
	}

	public int getVersionColspanColspan() {
		return versionItems.size();
	}
}

Comments:0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://sinsengumi.net/blog/2011/01/teeda%e3%81%a7colspan%e3%81%99%e3%82%8b/trackback/
Listed below are links to weblogs that reference
Teedaでcolspanする from sinsengumi血風録

Home > Java > Teedaでcolspanする

Search
Feeds
Meta

Return to page top