Hi,
I am trying to create a table from a list and to display image based on the
type of each row I encountered.
Here is snippet code of my Home.page
<property name="currentRow" />
<component id="eachEntry" type="For">
    <binding name="source" value="entries"/>
    <binding name="value" value="currentRow" />
    <binding name="element" value="literal:tr"/>
</component>
<asset name="dog" path="context:/image/dog.gif"/>
<asset name="cat" path="context:/image/cat.gif"/>
<asset name="bird" path="context:/image/bird.gif"/>
<asset name="fish" path="context:/image/fish.gif"/>
<component id="charName" type="Image">
    <binding name="image" value="asset:currentRow.animal"/>
</component>

in the Home.java
There is a method getAnimal which returns String  i.e. dog, cat .etc.

However, the page exception shows me
 Component Home does not contain an a
sset named 'currentRow.animal'.
  org.apache.tapestry.BindingException Component Home does not contain an
asset named 'currentRow.animal'. binding:
[EMAIL PROTECTED],
location=context:/WEB-INF/Home.page, line 22, column 56]

If I change the line
<binding name="image" value="asset:currentRow.animal"/>
to
<binding name="image" value="asset:dog"/>

It works fine but every row image will be dog.gif.

Does anyone have idea?

Thanks in advance for your help.
Thanks
David

Reply via email to