You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Edvin Syse <ed...@sysedata.no> on 2007/08/22 13:30:09 UTC

Wicket generates invalid HTML/CSS with ListView

Hi,

I use Wicket 1.3-beta2. When I construct a ListView and 
setOutputMarkupId(true) on the listItem itself, the constructed id in 
the HTML-code is only a number. This breaks the CSS 2 standard, that 
says that the id cannot contain only numbers.

Is there a way to prepend the id with a string, for example the 
wicket:id of the component? (That seems to be standard for most other 
elements when I setOutputMarkupId(true) on them).

Example to reproduce:

ListView lw = new ListView("lw", someList) {
	protected void populateItem(final ListItem item) {
		item.setOutputMarkupId(true);

		// Add other elements
	}
}

The HTML:

<ul>
	<li wicket:id="lw"> .. Other elements here ..</li>
</ul>

The rendered output:

<ul>
	<li wicket:id="lw" id="30"> .. Other elements here ..</li>
</ul>

-- Edvin Syse


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


Re: Wicket generates invalid HTML/CSS with ListView

Posted by Igor Vaynberg <ig...@gmail.com>.
already fixed in beta3

-igor


On 8/22/07, Edvin Syse <ed...@sysedata.no> wrote:
>
> Hi,
>
> I use Wicket 1.3-beta2. When I construct a ListView and
> setOutputMarkupId(true) on the listItem itself, the constructed id in
> the HTML-code is only a number. This breaks the CSS 2 standard, that
> says that the id cannot contain only numbers.
>
> Is there a way to prepend the id with a string, for example the
> wicket:id of the component? (That seems to be standard for most other
> elements when I setOutputMarkupId(true) on them).
>
> Example to reproduce:
>
> ListView lw = new ListView("lw", someList) {
>         protected void populateItem(final ListItem item) {
>                 item.setOutputMarkupId(true);
>
>                 // Add other elements
>         }
> }
>
> The HTML:
>
> <ul>
>         <li wicket:id="lw"> .. Other elements here ..</li>
> </ul>
>
> The rendered output:
>
> <ul>
>         <li wicket:id="lw" id="30"> .. Other elements here ..</li>
> </ul>
>
> -- Edvin Syse
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>