Hey Alec,

Looking at small excerpts from a large file leaves too much to the
imagination. Can you create a minimal but complete page and component
that reproduces the problem?

It feels like there is a bad return type or something on one of the
methods in the chain, so having a complete non-working example would
make it easier to debug.

Here is my working example, I tried to make it close to what you are doing.

****************** myapp.pages.Start.java:
public class Start
{
        public List<String> getStrings() {
                List<String> strings = new ArrayList<String>();
                strings.add("Hello");
                strings.add("Goodbye");
                return strings;
        }
        
        @SuppressWarnings("unchecked")
        public List<MyMap> getMaps() {
                List<MyMap> maps  = new ArrayList<MyMap>();
                MyMap map = new MyMap();
                map.put(0, "Zero");
                map.put(1, "One");
                maps.add(map);
                map = new MyMap();
                map.put("horse", "buck");
                map.put("goose", "egg");
                maps.add(map);
                return maps;
        }
        
        public String getSomethingStrange() {
                return (String)getMaps().get(0).get(1);
        }
}

****************** myapp.pages.Start.tml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

<t:layout t:strings="prop:strings" t:maps="prop:maps"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

This is the body

</t:layout>

******************** myapp.components.Layout.java

public class Layout {
        @Parameter
        private List<String> _strings;

        @Parameter
        private List<MyMap> _maps;

        public String getSomethingStrange() {
                return (String)_maps.get(0).get(1);
        }
        public List<String> getStrings() {
                return _strings;
        }

        public void setStrings(List<String> strings) {
                _strings = strings;
        }

        public List<MyMap> getMaps() {
                return _maps;
        }

        public void setMaps(List<MyMap> maps) {
                _maps = maps;
        }

}


******************** myapp.components.Layout.tml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
<body>
<p>Strange: ${somethingStrange}</p>
<div style="border: thin red solid;"><t:body /></div>
</body>
</html>

******************** MyMap.java (for completeness...)

package joshcan.test;

import java.util.TreeMap;

@SuppressWarnings("unchecked")
public class MyMap extends TreeMap {

        @Override
        public Object get(Object key) {
                Object o = super.get(key);
                return "my" + o.toString();
        }

}


************* Rendered output (hand formatted for readability)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<link href="/assets/tapestry/default.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>Strange: myOne</p>
<div style="border: thin red solid;">This is the body</div>
</body>
</html>



Hope that helps,
Josh

-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to