Java Mailing List Archive

http://www.gg3721.com/

Home » users.tapestry »

[T5.1.0.5] Loop inside grid

Halil Karakose

2010-09-03

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi all,
Does it make sense to use a loop to generate t:parameter components inside a
grid?

    <t:grid source="searchResults" row="searchResult"
model="searchResultDisplayModel">
       <t:loop source="selectedMandatoryAttributes"
value="anAttribute">
          <t:parameter name="${anAttribute}">xxx</t:parameter>
       </t:loop>
    </t:grid>


Actually my real problem is to display a HashMap inside a grid. *What if my
row object is a hashmap, how could I display the values in a grid? *

Following code demonstrates the types of my objects(searchResults,
searchResults,
searchResultDisplayModel)

List<HashMap<String,String>> searchResults;

HashMap<String, String> searchResult;

public BeanModel getSearchResultDisplayModel() {
    BeanModel model = beanModelSource.createDisplayModel(Object.class,
resources.getMessages());

    Set<String> attributeSet = searchResults.keySet();
    for (String s : attributeSet) {
       model.add(s, null);
    }

    return model;
}

Thanks...
©2008 gg3721.com - Jax Systems, LLC, U.S.A.