I was hoping on the lines, where you do "get(<component id>)"; Wicket returns
the Component.
So if there was a way to customize the nomenclature of what the "names" of
the fields are in a loop then it would be easy to refer to components via
name directly.

... I can't do [IN CONCEPT] get("additionalFeatures").get("<My naming
convention Sub Item component Id>").getDefaultModelObject() or something.
<-- I was asking if there was any magical way like that.

Not a big deal , I worked around . For the sake of discussion my ListItem is
defined by the following:

ListView additionalFeatures = new ListView<String>("additionalFeatures",
additionalFeaturesKeyList) {
...
                        @Override
                        protected void populateItem(ListItem<String> item) {
                                String key = item.getModelObject(); //Assume 
this to be the Name / Id of
something
                                item.add(new Label("name", new Model(key)));
                                
                                String modelKeyName = 
MarshalUtils.toAlphaNumeric(key);
                                final Feature feature = 
additionalFeaturesMap.get(key);
                                item.add(new TextArea("value", new 
Model(feature.getValue().toString()))
                                                .setLabel(new 
Model(modelKeyName))
                                                .setMarkupId(key));
                        }
...
}



What I went with at the end was:

                                                        ListView listView = 
(ListView)get("additionalFeatures");
                                                        for (int x=0; 
x<listView.size(); x++) {
                                                                ListItem 
additionalFeatureField = (ListItem)listView.get(x);

                                                                //Now I work
with the ListItem however I want to and derive what I want :)
                                                         ...
                                                        }

..Which works also, but not as elegant as I hoped. But I realize its a LIST,
so my expectations are perhaps unjustified and iteration of the list is
logical and inescapable.



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Changing-Accessing-name-of-ListItem-in-ListView-tp3218777p3219010.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to