Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

ComponentBackground | componentJavadoc=ListView

Background

FAQ

  • How do I repaint a ListView via Ajax?
    • - You can't, you need to put it into a WebMarkupContainer and repaint that container instead.

More
If you take a closer look at the markup, and the markup that
gets generated, you can clearly see the problem for a listview:

In the server side markup:

...


<ul>
<li wicket:id="listitem"><span wicket:id="label">some value</span></li>
</ul>
Children Display
excerpttrue

In the client side markup:

...


<ul>
<li><span>foo</span></li>
<li><span>bar</span></li>
<li><span>foobar</span></li>
</ul>

What you typically want to do is to redraw the complete <ul></ul>
part, because most browsers really don't appreciate when you replace
parts of a tag, especially when you are working with a <table>.

As you can see in this example, the <ul> tag is not a component, and
Wicket is not aware of it. Even if you were to do:
listview.setOutputMarkupId(true), this wouldn't work, as the listview
itself doesn't have a tag associated with it.

That is why you need to provide the WebMarkupContainer yourself as a
wrapper for the listview.

...

Examples