tapestry-user@jakarta.apache.org
[Top] [All Lists]

Re: Problems with contrib:Table

Subject: Re: Problems with contrib:Table
From: "Peter Svensson"
Date: Thu, 2 Mar 2006 18:22:21 +0100
<SmackForehead>

My problem was that when I build the list from a hashtable I added the keys
instead of the object. ie;

list.add(key);

instead of;

list.add(hastable.get(key));


Aaaarghhh!!!!

And that's why tapestry said (quite truthfully) that it could find no method
getId() or getName() or __java.lang.Integer___  !!!

Cheers,
PS

</SmackForehead>

On 3/2/06, Peter Svensson <psvensson@xxxxxxxxx> wrote:
>
> Hi!  I am having trouble making contrib:Table work. I am doing some very
> silly mistake somwhere, because no matter what I do, something fails.
> Here's what I'm doing;
>
> html;
> ...
> <table jwcid="choices">
>     </table>
>
> ...
>
> page;
> I have been experimenting heavily with name:name:name and such
> incantations. No dice.
> ...
> <component id="choices" type="contrib:Table">
>           <binding name="source" value="cc"/>
>           <binding name="columns" value='name, Id'/>
>     </component>
> ...
>
> page class;
>
> ...
> public LinkedList getCc()
>     {
>         Hashtable ht = getCsel();
>         LinkedList rv = new LinkedList();
>
>         Enumeration en = ht.keys();
>         while(en.hasMoreElements())
>         {
>             Object el = en.nextElement();
>             System.out.println("--- putting "+el+" in choices list");
>             rv.add(el);
>         }
>         return rv;
>     }
> ...
>
> The class that the list is made up of ;
>
> ...
> private Integer ID ;
> private String Name ;
>
> public String getName()
>         {
>             return Name;
>         }
> public Integer getID()
>         {
>             return ID;
>         }
> ...
>
> Happy error message;
>
> org.apache.tapestry.BindingException  Unable to read OGNL expression
> '<parsed OGNL expression>' of $ContactList_35@1e07f4b[ContactList]:
> $ContactList_35.name  binding: ExpressionBinding[ContactList name, Id]
> location: context:/WEB-INF/ContactList.page, line 12, column 47
> 7 <binding name="listener" value="listener:onClick"/> 8 <binding
> name="parameters" value="object"/> 9 </component> 10 <component
> id="choices" type="contrib:Table"> 11 <binding name="source" value="cc"/>
> 12 <binding name="columns" value='name, Id'/> 13 </component> 14
> </page-specification>      org.apache.hivemind.ApplicationRuntimeException  
> Unable
> to read OGNL expression '<parsed OGNL expression>' of
> $ContactList_35@1e07f4b[ContactList]: $ContactList_35.name  component: 
> $ContactList_35@1e07f4b[ContactList]
>  location: context:/WEB-INF/ContactList.page, line 2, column 57
> 1<!DOCTYPE page-specification PUBLIC "-//Apache Software
> Foundation//Tapestry Specification 4.0//EN" "
> http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";> 2<page-specification
> class="com.tcrm.domain.ContactList"> 3 <property name="typeName"
> persist="session"/> 4 <property name="instances" persist="session"/> 
> 5<property name="object"/>
> 6 <component id="addlink" type="DirectLink"> 7 <binding name="listener"
> value="listener:onClick"/>      ognl.NoSuchPropertyException
> $ContactList_35.name  name: name  target:
> $ContactList_35@1e07f4b[ContactList]
>
>
>
> I was initially going to say "Why Why Why!! ??? Argh!!" but as any
> civilized person I instead say; "Chucks, that's strange, innit?"
>
> Any hints will be much appreciated.
> Cheers,
> PS
>
<Prev in Thread] Current Thread [Next in Thread>