i thought i have to use it when i need the updatet values... On Wed, Aug 6, 2008 at 4:28 PM, Hoover, William <[EMAIL PROTECTED]> wrote:
> Why do you use propertiesList.setReuseItems(true)? > > -----Original Message----- > From: Markus Haspl [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2008 10:20 AM > To: [email protected] > Subject: ListView in Forms > > hi, > > first, i'm a very newbie to wicket... I want to add a ListView in a > Form. > The ListView has two Texfields and one Checkbox each row. When i submit > the form the values are still the old ones. > > here the code: > > private class InputForm extends Form { > > > > IModel pluginPropertiesModel; > > public InputForm(String id, IPlugin plugin){ > super(id); > > > > final IPlugin Iplugin = plugin; > > pluginPropertiesModel = new LoadableDetachableModel(){ > public Object load() > { > log.debug("load the Model"); > Iplugin.loadPluginProperties(); > return pluginProperties; > } > }; > > ListView propertiesList = new ListView("pluginRepeater", > pluginPropertiesModel) { > > @Override > public void populateItem(ListItem item) > { > PluginProperties pluginProperties = > (PluginProperties)item.getModelObject(); > TextField propertiesName = new TextField("name",new > Model(pluginProperties.getName())); > TextField propertiesValue = new > TextField("value",new Model(pluginProperties.getValue())); > CheckBox propertiesDefault = new > CheckBox("defaultProperty",new > Model(pluginProperties.isDefaultProperty())); > item.add(propertiesName); > item.add(propertiesValue); > item.add(propertiesDefault); > } > }; > propertiesList.setReuseItems(true); > add(propertiesList); > > add(new Button("saveButton")); > > > } > > public void onSubmit() > { > List<PluginProperties> pluginProperties = > (List<PluginProperties>)pluginPropertiesModel.getObject(); > for(PluginProperties property:pluginProperties){ > info(""+property.getName()+": "+property.getValue()+" == > "+property.isDefaultProperty()); > log.debug(""+property.getName()+": > "+property.getValue()+" > == "+property.isDefaultProperty()); > } > > > > > } > } > > > thanks in advance > markus > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
