Observing links in label-html-text


i got following idea but do not have an idea how to implement properly.

I would like to show html-text with links in an label-field. If some link is clicked in the html text i would like to become informed about it by a listener. A click should not result in opening a new web site, but i would like to start some processes in the vaadin UI.

Text shown in vaadin label may look like:
Dear user, if you click this
then a new help dialog will be opened.
But if you click that
, then the current dialog will be closed.
To log out, click here:

For now i do not have an idea how to implement that stuff.
Any ideas are welcome.

Thanks florian




I think i found a way. Have to register js functions.

				new JavaScriptFunction() {
					public void call(JSONArray arguments) throws JSONException {
						String application = arguments.getString(0);

				new JavaScriptFunction() {
					public void call(JSONArray arguments) throws JSONException {
						// do signoff

		label.setValue("Click this <a href='javascript:com.example.view.open(\"org.example.view.help\");'>Link</a> to open view. <br>"
				+ "Or that <a href='javascript:com.example.signoff();'>Link</a> to signoff.");

Might that approach work properly at all?

Best Florian


For navigation inside labels with HTML content - jumping between the different views - similar to a wiki we use following listener.


						new UriFragmentChangedListener() {
							public void uriFragmentChanged(
									UriFragmentChangedEvent source) {
								String frg = source.getUriFragment(); 								

                                // do something with the information								

Hi Peter,

thanks a lot for the hint.

I will investigate how to integrate the fragments. We are using vaaclipse and have to process complex events. Maybe i can pass all required information by fragment to control the things that have been done.

Thanks a lot,

I forgot to give you the original link: