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.

1
  • 1
    weird question... we need more infos Commented Feb 8, 2011 at 10:37

4 Answers 4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
The naming does imply that it wouldn’t work in production mode, but IIRC the id should be usable then as well.
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 :)

Comments

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.

Comments

-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">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.