embed links in dynamic generated xhtml

hallo vaadin team,

i want to embed (navigation) links into generated xhtml (that resides in a label in a table cell).
i tried two approaches:

– using Button with link style + ExternalLayout…
this is complicated and works not very well due to the dynamic nature (creation+removal+adding of ExternalLayouts+Buttons, order of inserting xhtml in the page vs. inserting the components that should get placed in the xhtml, out-of-sync etc. …perhaps the most complicated sollution but you are free to style the labels content.)

– usign hash urls in normal html links + UriFragmentUtility
works so far, but i don’t want pollute the browsers history!

so, i have a question and an idea:

is there any alternative to solve my problem?
(btw: i know, another sollution could be the use of a more complicated component structure (layout+link-style-buttons) instead of the label. the idea is obvious because i am using components in my table cells already. but why it has to be so complicated?)

using the simple plain html links in a label + not putting those fragments into the history (because its no application state. it is an action.)
i don’t know whether the history entry is placed by the browser or by vaadin gwt code, but in the former case it could be removed (?) and in the latter case simply not put.
to identify a fragment as a not-pollute-the-history-fragment one may start the fragment with ‘!’ (! means ‘not’).

so a link like href=“#!path/in/the/ui/space/and?other=appstate&action=justDoIt&x=123” would not change the history. the app developer has to parse the fragment himself anyway and may set a new fragment if the application state really changes.

what do you think about it?
maybe i am totally wrong and confused?!

suprise (for me too),
i dived into gwt history, then javascript history and location, and then…
i just found the sollution:

one can use plain old html links like this: Just Do It.

in my case i split the fragment at ‘?’.

  • before ‘?’ is my application state. i use this to navigate to the right ui space (view, tab etc.), for example.
  • after ‘?’ is my action. i use this to change some selection, for example. i redirect this information to the view.

the ‘!’ tells me to “reset” the fragment to the last one.
vaadin adds a history entry only if the fragment changes, so the history is left untouched. :slight_smile:
problem solved.

thanks anyway. for vaadin. that rocks.

bad suprise: i doesn’t work in firefox.
even if you’re using a full url (not only the fragment part), it works not very well.
cause if you need the fragment-reset (to get the fragmentChanged events at clicking again on the same link), you’re out of luck.

btw: and for the case that a user is using the firefox ‘link alert’ add-on, an ugly javascript icon is shown…
i am testing <a onclick=… instead of <a href=…