8

I would like that my Vaadin components be set a style id:

<div id="menu"> ... </div>

and not only a style class:

<div class="menu"> ... </div>

Anyone have an idea? Thanks.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Jean-Eric
  • 81
  • 1
  • 4

4 Answers4

2

The old setDebugId(id) method was deprecated since Vaadin 7.0.

You can use the setId(id) method.

The new method name "setId" is better than old name "setDebugId", because it is not only working in DEBUG mode, but also in PRODUCTION mode.

Li Ying
  • 2,261
  • 27
  • 17
2

So you would want to set an ID yourself, or that Vaadin set them for you?

You can set ID’s yourself using the setDebugId method for each component instance. Do note, that each ID should be unique for each individual component instance.

Jouni
  • 2,830
  • 15
  • 12
  • 2
    Yes through vaadin. So the debugId is what I need, but the word debug in it would tell to not use that in production no? – Jean-Eric Feb 10 '11 at 10:15
  • The naming does imply that it wouldn’t work in production mode, but IIRC the id should be usable then as well. – Jouni Feb 17 '11 at 06:28
2

We can use the id which set with setDebugId() method in production mode also.
I opened a ticket about that (http://dev.vaadin.com/ticket/7867), and response is i can use those ids in production mode also.
Then i made a small demo application and i saw the ids were there in production mode :)

saban
  • 120
  • 2
  • 9
-3

you can use a 1 id and as many classes to an item as you want like this

<div id="menu" class="menu menu-2 etc">
sat
  • 1,009
  • 3
  • 19
  • 41