You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Frank <fa...@hotmail.com> on 2005/04/15 16:00:31 UTC
Help with component expression
Hello, I have the following in Home.Page:
<component id="InstertAuthorTable" type="contrib:Table">
<binding name="tableModel" expression="AuthorTable"/>
</component>
Web server reports:
Unable to resolve expression 'AuthorTable' for tutorial.HibLib.Home@c5122f[Home]
I do not understand what is wrong. What does AuthorTable mean?
Thanks
Frank.
Re: Help with component expression
Posted by Frank <fa...@hotmail.com>.
I changed it, I now get
Unable to resolve expression 'authorTable' for
tutorial.HibLib.Home@18eb7b8[Home].
I can send you the HibLib zip file if you need to look at it.
Thanks
Frank
----- Original Message -----
From: "Markus Eberle" <ma...@tngtech.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, April 15, 2005 10:38 AM
Subject: Re: Help with component expression
> No, you don't have to rename it, is ok so.
> Have you tried to rename
> <binding name="tableModel" expression="AuthorTable"/>
> in to
> <binding name="tableModel" expression="authorTable"/>
> with a lowercase "author".
>
>
> On Friday 15 April 2005 16:06, Frank wrote:
>> Here is my code from the tutorial
>>
>> // Return the model of the table
>> public ITableModel getAuthorTable() throws HibernateException
>> {
>> Object[] data = null;
>> Session session = getSession();
>> Query query = null;
>> query = session.createQuery("from Author as auth");
>>
>> // Generate a simple sorting column model that uses OGNL to get the
>> column
>> data
>> ITableColumnModel objColumnModel =
>> new ExpressionTableColumnModel(new String[] {
>> "First Name", "getFirstName()",
>> "Last Name", "getLastName()"
>> }, true);
>>
>> data = query.list().toArray();
>> session.close();
>> // Create the table model and return it
>> return new SimpleTableModel(data, objColumnModel);
>> }
>>
>> Do I need to change getAuthorTable() to getAuthorTableModel()
>>
>> Thanks
>>
>> Frank
>
> ---------------------------------------------------------------------
> 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
Re: Help with component expression
Posted by Markus Eberle <ma...@tngtech.com>.
No, you don't have to rename it, is ok so.
Have you tried to rename
<binding name="tableModel" expression="AuthorTable"/>
in to
<binding name="tableModel" expression="authorTable"/>
with a lowercase "author".
On Friday 15 April 2005 16:06, Frank wrote:
> Here is my code from the tutorial
>
> // Return the model of the table
> public ITableModel getAuthorTable() throws HibernateException
> {
> Object[] data = null;
> Session session = getSession();
> Query query = null;
> query = session.createQuery("from Author as auth");
>
> // Generate a simple sorting column model that uses OGNL to get the column
> data
> ITableColumnModel objColumnModel =
> new ExpressionTableColumnModel(new String[] {
> "First Name", "getFirstName()",
> "Last Name", "getLastName()"
> }, true);
>
> data = query.list().toArray();
> session.close();
> // Create the table model and return it
> return new SimpleTableModel(data, objColumnModel);
> }
>
> Do I need to change getAuthorTable() to getAuthorTableModel()
>
> Thanks
>
> Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Help with component expression
Posted by Frank <fa...@hotmail.com>.
Here is my code from the tutorial
// Return the model of the table
public ITableModel getAuthorTable() throws HibernateException
{
Object[] data = null;
Session session = getSession();
Query query = null;
query = session.createQuery("from Author as auth");
// Generate a simple sorting column model that uses OGNL to get the column
data
ITableColumnModel objColumnModel =
new ExpressionTableColumnModel(new String[] {
"First Name", "getFirstName()",
"Last Name", "getLastName()"
}, true);
data = query.list().toArray();
session.close();
// Create the table model and return it
return new SimpleTableModel(data, objColumnModel);
}
Do I need to change getAuthorTable() to getAuthorTableModel()
Thanks
Frank
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Help with component expression
Posted by Markus Eberle <ma...@tngtech.com>.
On Friday 15 April 2005 16:00, Frank wrote:
> Hello, I have the following in Home.Page:
>
> <component id="InstertAuthorTable" type="contrib:Table">
> <binding name="tableModel" expression="AuthorTable"/>
> </component>
>
> Web server reports:
>
> Unable to resolve expression 'AuthorTable' for tutorial.HibLib.Home@c5122f[Home]
>
> I do not understand what is wrong. What does AuthorTable mean?
Your page class has to have a method
ITableModel getAuthorTableModel()
that returns the table model (~ Table data) for this table.
HTH
Markus
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org