Hello,

You can use myComponent.setMarkupId("blah"), but then it's up to you to
ensure the id uniqueness.

Regards,

Pierre


On Tue, Apr 13, 2010 at 12:35 AM, <b...@actrix.gen.nz> wrote:

> Hi,
>
> Wicket has its own mind - it changes IDs in HTML forms so JavaScript
> breaks.
>
> Example:
>
> Source:
> <input type="button" wicket:id="addButton" id="addButton"
> value="Add"/>
>
> Generated:
> <input type="button" id="addButtona" value="Add" name="addButton"/>
>
> Please note that Wicket renames the id from "addButton" to
> "addButtona" while it does not change the name attribute value.
>
> So we would have to create a Button subclass and:
>
>    @Override
>    public String getMarkupId(){
>        // As an example, use the wicket:id value ...
>        return getId();
>    }
>
> and in HTML, we have to write a warning as a reminder of this hack:
>    <!-- Wicket overrides id from wicket:id value -->
>
> This is a maintenance problem and a performance problem because the
> additinal classes cost memory and CPU.
>
> Any ideas?
>
> Thanks,
>
> Bernard
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Les deux règles universelles du bide :

1) on n'explique pas un bide

2) dans le futur, un bide sera toujours un bide.

Reply via email to