Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Wicket changes the id of the html elements?

If I write

<form wicket:id="form" id="form>

or even

<form wicket:id="form>...

Then the rendered HTML shows the id 'form' appended with different numbers whenever the page is refreshed e.g.

   <form id="form7"....

Is there a way to disable this behavior of the Wicket framework?

like image 222
Monis Iqbal Avatar asked Jan 16 '10 14:01

Monis Iqbal


1 Answers

We set markup ids by hand extensively on our project to ease automatic testing with Selenium testing framework. It definitely works.

Component.setOutputMarkupId(true); // write id attribute of element to html
Component.setMarkupId("someid"); // id attribute of element is "someid"
like image 178
Michal Bernhard Avatar answered Sep 28 '22 04:09

Michal Bernhard