Okay, this helps, but how do I link different components to each radio button? If all my radio buttons would associate with a textfield it would be easy because I would just do this:
group.add(new CheckGroupSelector("groupselector")); ListView bar = new ListView("choices", foo.getChoices()) { protected void populateItem(ListItem item) { item.add(new Check("checkbox", item.getModel())); item.add(new Label("nameLabel", new PropertyModel(item.getModel(), "name"))); item.add(new TextField("nameField", new PropertyModel(item.getModel(), "nameField"))); } }; group.add(bar); However, some of my radio buttons don't have text fields, so how do I do this and still make it a group? Can I just manually group those into a WMC and add that one the group? What I am trying to do is to be able to grab my value despite each radio button being associated with a different type of component (textfield, textarea, AutocompleteTextArea, etc.). Thanks! Michael -----Original Message----- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2008 1:42 PM To: users@wicket.apache.org Subject: Re: Linking radio buttons to textfield model update RadioChoice supports wantOnSelectionChangedNotification() you can use that to get a callback whenever a new option is selected, then call clearinput() on whatever textbox needs to be made blank -igor On Tue, Mar 18, 2008 at 1:36 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Anyone? I also forgot to mention that three of the radio buttons are > associated with a textbox, but two are not (radio buttons without > textfields). Would love to know how to build this and properly assign > the model. > > Michael > > > > -----Original Message----- > From: Michael Mehrle [mailto:[EMAIL PROTECTED] > Sent: Monday, March 17, 2008 1:56 PM > To: users@wicket.apache.org > Subject: Linking radio buttons to textfield model update > > I've got a group of seven radio buttons, some of which are supposed to > be correlated with a textfield. Meaning, when I select a particular > radio button the textfield on its right side is supposed to get a cursor > focus. Similarly, whenever I change my radio button selection, I need > any previously entered text to be cleared (and the model as well). > > I can imagine various scenarios of how to write this - is there a > default/easy approach without having to sling JavaScript? > > Michael > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]