You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jchappelle <jc...@4redi.com> on 2008/12/05 23:34:03 UTC

CheckGroupSelector not working at all in a Wizard

I have followed the example exactly(from what I can see) and when I click my
"Select All" button nothing happens to the other buttons. Here is the code:

This is in the constructor of a WizardStep:

			Form form = new Form("form")
			{
				private static final long serialVersionUID = 1L;

				@Override
				protected void onSubmit()
				{
					super.onSubmit();
				}
				
			};
			LoadableDetachableModel contactsModel = new LoadableDetachableModel()
			{
				private static final long serialVersionUID = 1L;
				
				@Override
				protected Object load()
				{
					ContactSession sess = new ContactSessionImpl();
					List<Contact> result = new ArrayList<Contact>();
					try
					{
						result = sess.getContacts(contactsLogin.getLoginName(),
contactsLogin.getPassword(), contactsLogin.getService());
					}
					catch(ContactsRetrievalException e)
					{
						//TODO:
						e.printStackTrace();
					}
					return result;
				}
				
			};
			CheckGroup group = new CheckGroup("group", new ArrayList());
			group.add(new CheckGroupSelector("groupselector"));
			ListView contacts = new ListView("contacts", contactsModel)
			{
				private static final long serialVersionUID = 1L;

				@Override
				protected void populateItem(ListItem item)
				{
					Contact contact = (Contact)item.getModelObject();
					CheckBox contactCheckBox = new CheckBox("contactCheckBox", new
Model());//TODO: (JBC)
					Model titleModel = null;
					if(contact.getName() == null || contact.getName().trim().length() == 0)
					{
						titleModel = new Model(contact.getEmailAddress());
					}
					else
					{
						titleModel = new Model(contact.getName());
					}
					Label contactTitle = new Label("contactTitle", titleModel);
					Label contactEmail = new Label("contactEmail", new
Model(contact.getEmailAddress()));
					item.add(contactCheckBox);
					item.add(contactTitle);
					item.add(contactEmail);
				}
			};
			group.add(contacts);
			
			form.add(group);
			add(form);


Could someone please tell me what I am doing wrong?

Thanks,

Josh
-- 
View this message in context: http://www.nabble.com/CheckGroupSelector-not-working-at-all-in-a-Wizard-tp20863784p20863784.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: CheckGroupSelector not working at all in a Wizard

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Fri, 05 Dec 2008, jchappelle wrote:
> I have followed the example exactly(from what I can see) and when I click my
> "Select All" button nothing happens to the other buttons. Here is the code:

I've never used CheckGroupSelector, but as you have your 
CheckBoxes inside a ListView, you should probably call
setReuseItemModels(true) (or something like that) for the 
ListView.

Best wishes,
Timo


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