Thanks, this does fix this particular bug, but now I can't add items into the
ListView. I'm trying to add items via AJAX, and with reuseItems turned on,
it no longer adds the new items to the list like it should be.
igor.vaynberg wrote:
>
> if your listview is in a form you have to call
> listview.setreuseitems(true);
>
> -igor
>
>
> On 9/20/07, Nick Busey <[EMAIL PROTECTED]> wrote:
>>
>>
>> So I've got what appears to be a very strange bug. I have a CheckGroup
>> with a
>> ListView of Checks among other things. Everything seems to work fine if
>> you
>> render the form and submit it without any errors the first time. However,
>> if
>> you hit any errors (like not selecting any Checks), and are bounced back
>> to
>> the form with an error rendered, if you select a Check and re-submit it,
>> it
>> dies with the following error:
>>
>> WicketMessage: submitted http post value [check22] for CheckGroup
>> component
>> [14:slurpFormResults:resultPanel:group] contains an illegal relative path
>> element [check22] which does not point to a Check component. Due to this
>> the
>> CheckGroup component cannot resolve the selected Check component pointed
>> to
>> by the illegal value. A possible reason is that componment hierarchy
>> changed
>> between rendering and form submission.
>>
>> Root cause:
>>
>> org.apache.wicket.WicketRuntimeException: submitted http post value
>> [check22] for CheckGroup component
>> [14:slurpFormResults:resultPanel:group]
>> contains an illegal relative path element [check22] which does not point
>> to
>> a Check component. Due to this the CheckGroup component cannot resolve
>> the
>> selected Check component pointed to by the illegal value. A possible
>> reason
>> is that componment hierarchy changed between rendering and form
>> submission.
>> at
>> org.apache.wicket.markup.html.form.CheckGroup.convertValue(CheckGroup.java
>> :141)
>> etc..
>>
>> Here's the code:
>>
>> final ListView contactsList = new
>> ListView("contactRepeater", new
>> PropertyModel(this,
>> "contacts"))
>> {
>> private static final long serialVersionUID = 1L;
>>
>> @Override
>> protected void populateItem(ListItem item)
>> {
>> ExternalContact p = (ExternalContact)
>> item.getModelObject();
>> Check check = new Check("selected", new
>> Model(item.getIndex()));
>> String mail = p.getEMailAddress();
>> if (mail == null)
>> {
>> p.setEMailAddress(p.getUserName
>> ());
>> }
>> check.add(new
>> SimpleAttributeModifier("id", p.getEMailAddress()));
>> // Create and style image
>> StaticImage image = new
>> StaticImage("pic",
>> new Model(p.getImageURL()));
>> String pic = p.getImageURL();
>> Label picBlock = new Label("picBlock",
>> new
>> Model());
>> picBlock.add(new
>> SimpleAttributeModifier("class", "noPictureInactive"));
>> item.add(picBlock);
>> item.add(image);
>> String emailLabel = new String();
>> emailLabel = p.getEMailAddress();
>>
>> item.add(new Label("emailLabel", new
>> Model(emailLabel)));
>> item.add(check);
>> item.add(new
>> SimpleAttributeModifier("for", p.getEMailAddress()));
>> item.add(new
>> SimpleAttributeModifier("class", "pictureContainer " +
>> p.getType().toString()));
>> }
>> };
>> group = new CheckGroup("group", new ArrayList());
>> group.add(contactsList);
>> group.add(new CheckGroupSelector("groupSelect"));
>> group.setOutputMarkupId(true);
>>
>> Any help or ideas would be greatly appreciated. Thanks!
>> --
>> View this message in context:
>> http://www.nabble.com/CheckGroup-form-submission-bug-tf4489122.html#a12802495
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/CheckGroup-form-submission-bug-tf4489122.html#a12803008
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]