Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:28:24+00:00 2026-05-30T09:28:24+00:00

I have strange stacktrace when click to submit button (this code is rendered but

  • 0

I have strange stacktrace when click to submit button (this code is rendered but don’t work form processing). Example class:

public class SamplePage extends WebPage {

    private List<String> list = Arrays.asList(new String[] { "item1", "item2", "item3" });
    private List<String> selectedItem = Arrays.asList(new String[] { "item1" });

    public SamplePage(final PageParameters parameters) {
        super(parameters);

        Form<?> form = new Form<Void>("form");
        form.add(new Button("submin") {
            @Override
            public void onSubmit() {
                System.out.println("Selected");
                for (String tag : selectedItem)
                    System.out.println(tag);
            }
        });
        ListMultipleChoice<String> selector = new ListMultipleChoice<>("itemSelector",
            new PropertyModel<List<String>>(this, "selectedItem"), list);
        add(form);
        form.add(selector);
    }
    public List<String> getSelectedItem() {
        return selectedItem;
    }
    public void setSelectedItem(List<String> selectedItem) {
        this.selectedItem = selectedItem;
    }
} 

Caused by: java.lang.UnsupportedOperationException
    at java.util.AbstractList.remove(AbstractList.java:161)
    at java.util.AbstractList$Itr.remove(AbstractList.java:374)
    at java.util.AbstractList.removeRange(AbstractList.java:571)
    at java.util.AbstractList.clear(AbstractList.java:234)
    at org.apache.wicket.markup.html.form.FormComponent.updateCollectionModel(FormComponent.java:1531)
    at org.apache.wicket.markup.html.form.ListMultipleChoice.updateModel(ListMultipleChoice.java:369)
    at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:221)
    at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:192)
    at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:273)
    at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:261)
    at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:244)
    at org.apache.wicket.markup.html.form.FormComponent.visitComponentsPostOrder(FormComponent.java:388)
    at org.apache.wicket.markup.html.form.Form.internalUpdateFormComponentModels(Form.java:1701)
    at org.apache.wicket.markup.html.form.Form.updateFormComponentModels(Form.java:1666)
    at org.apache.wicket.markup.html.form.Form.process(Form.java:827)
    at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
    at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:692)
... 31 more

How I understand problem is in definition model, but I don’t understand why (I tried a lot of ways and didn’t check problem). When I created DropDownChoice in same way, all worked correctly, but in this case I used

new PropertyModel<String>(this, "field")

in contrast to

new PropertyModel<List<String>>(this, "selectedItem")

I think it’s very silly mistake and ask your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:28:25+00:00Added an answer on May 30, 2026 at 9:28 am

    Arrays.asList() returns a fixed size list, you (i.e. Wicket) cannot remove elements form it.

    Use another list instead:

    private List<String> selectedItem = new ArrayList<String>();
    
    public SamplePage(final PageParameters parameters) {
        ....
        selectedItem.add("item1");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to draw a model with 197 polygons but i have strange black
I have this strange call stack and I am stumped to understand why. It
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
I have this strange issue with my web app. You see, I'm using jQuery
I have strange issue with nested left-joins in postgresql... It's hard to explain, but
I have a very strange problem in my code. I'm using Ogre and I'm
I have strange problem with sharepoint and ajax functionality. We have an UpdatePanel placed
i have strange problem doing reporting: i have numerous clients with different issued invoices.
I have a strange requirement to ship an application without bundling .Net framework (to
We have very strange problem, one of our applications is continually querying server by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.