You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gin Yeah <gi...@gmail.com> on 2008/03/14 05:57:03 UTC

ListView: if my entry is one component, can I not have it nested inside the entry?

My list entry is only one component, but the only way I can get the ListView
to work is have the markup with one level nesting like this:

      <span wicket:id="entry">
            <span wicket:id="label">EEEEEE</span>
     </span>


Is it possible to just have markup without the additional level of nesting?
Like this:

      <span wicket:id="entry">EEEEEE</span>


and  somehow in java, make the "entry" span become my list entry component?:


new ListView("entry", data) {
    .... populateItem(ListItem item) {
               item.JUST-BECOME-THIS-COMPONENT(new Label("entry",
item.getModelObject().toString()));
         }
};

Re: ListView: if my entry is one component, can I not have it nested inside the entry?

Posted by Maurice Marrink <ma...@gmail.com>.
you should use item.setRenderBodyOnly(true) if you want to remove
<span wicket:id="entry"> and label.setrenderBodyOnly(true) to remove
the <span wicket:id="label">

By what you are describing you want item.add(    new
Label("label").setRenderBodyOnly(true)    );

Maurice

On Fri, Mar 14, 2008 at 5:57 AM, Gin Yeah <gi...@gmail.com> wrote:
> My list entry is only one component, but the only way I can get the ListView
>  to work is have the markup with one level nesting like this:
>
>       <span wicket:id="entry">
>             <span wicket:id="label">EEEEEE</span>
>      </span>
>
>
>  Is it possible to just have markup without the additional level of nesting?
>  Like this:
>
>       <span wicket:id="entry">EEEEEE</span>
>
>
>  and  somehow in java, make the "entry" span become my list entry component?:
>
>
>  new ListView("entry", data) {
>     .... populateItem(ListItem item) {
>                item.JUST-BECOME-THIS-COMPONENT(new Label("entry",
>  item.getModelObject().toString()));
>          }
>  };
>

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