/**
* 項目名稱:TapestryStart
* 開發模式:Maven+Tapestry5.x+Tapestry-hibernate+Mysql
* 版本:1.0
* 編寫:飛風
* 時間:2012-02-29
*/
package com.tapestry.app.pages;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.javascript.InitializationPriority;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
public class Scriptaculous {
@Property
@SuppressWarnings("unused")
private String firstName;
@Property
@SuppressWarnings("unused")
private String lastName;
@Inject
private JavaScriptSupport javaScriptSupport;
public void setupRender() {
javaScriptSupport.addScript(InitializationPriority.LATE, String.format("Effect.Grow('%s');", "expando"));
}
}
<html t:type="layout" title="tapestryStart Index" t:sidebarTitle="Framework Version"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
<div id="expando" style="padding: 10px; background-color: #eeeeee;">
<form t:type="form" t:autofocus="false">
<input t:type="TextField" t:id="firstName" t:mixins="TextboxHint" t:hintText="Enter First Name" t:hintColor="#808080"/>
<input t:type="TextField" t:id="lastName" t:mixins="TextboxHint" t:hintText="Enter Last Name" t:hintColor="#808080"/><br/>
</form>
</div>
</html>