You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by CHEUNG KIN WAI <02...@stu.vtc.edu.hk> on 2004/08/03 07:30:55 UTC
Question about IPage
Hi all. I am a beginner of Tapestry.
Now I am writing a simple application which includes a Table Component in my page.
I have a java class which generate a Table Model for the Table component.
However, when I execute the application, I receive an error message which ask me to implement the interface "IPage" in the java class.
I would like to ask why I need to implement this interface?
Here is the code of my application.
.html :
<html>
<body>
<style> td { text-align: center } </style>
<table jwcid="table" width="90%"
</body>
</html>
.page :
<page-specification class="Test">
<description><![CDATA[ add a description ]]></description>
<component id="table" type="contrib:Table">
<binding name="tableModel" expression="getTaleModel()"/>
</component>
</page-specification>
Test.java:
public class Test{
public ITableModel getTaleModel(){
Integer[] ManyNumber = new Integer[5];
for ( int i = 0 ; i < ManyNumber.length;i++) {
ManyNumber[i] = new Integer(i+1);
}
Object[] data = ManyNumber;
SimpleTableColumn[] aa = new SimpleTableColumn[1];
aa[0] = new SimpleTableColumn("Number",true);
ITableColumn[] columns = aa;
ITableModel model = new SimpleTableModel(data, columns);
return model;
}
}
Thank you all.
Jor Cheung
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Question about IPage
Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Hi there,
The IPage interface is essential to Tapestry - pages are not pages unless
they implement it. In general you should extends BasePage for components
with a HTML-template (this is your case), or AbstractPage, when your Java
class takes care of producing the output.
-Filip S. Adamsen
-----Original Message-----
From: CHEUNG KIN WAI [mailto:020517600@stu.vtc.edu.hk]
Sent: Tuesday, August 03, 2004 7:31 AM
To: Tapestry users
Subject: Question about IPage
Hi all. I am a beginner of Tapestry.
Now I am writing a simple application which includes a Table Component in my
page.
I have a java class which generate a Table Model for the Table component.
However, when I execute the application, I receive an error message which
ask me to implement the interface "IPage" in the java class.
I would like to ask why I need to implement this interface?
Here is the code of my application.
.html :
<html>
<body>
<style> td { text-align: center } </style>
<table jwcid="table" width="90%"
</body>
</html>
.page :
<page-specification class="Test">
<description><![CDATA[ add a description ]]></description>
<component id="table" type="contrib:Table">
<binding name="tableModel" expression="getTaleModel()"/>
</component>
</page-specification>
Test.java:
public class Test{
public ITableModel getTaleModel(){
Integer[] ManyNumber = new Integer[5];
for ( int i = 0 ; i < ManyNumber.length;i++) {
ManyNumber[i] = new Integer(i+1);
}
Object[] data = ManyNumber;
SimpleTableColumn[] aa = new SimpleTableColumn[1];
aa[0] = new SimpleTableColumn("Number",true);
ITableColumn[] columns = aa;
ITableModel model = new SimpleTableModel(data, columns);
return model;
}
}
Thank you all.
Jor Cheung
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org