I want to navigate from a link on a html site to another where a TabContainer with two different tabs is located.
I have one tab selected by default (which I want to keep) in the destination html file.
How do I have to put the link so that this is working? I found several documents on the net but nothing works. So probably someone needs to explain this to me the dumb way.
Here is the destination TabContainer:
<div dojoType="dijit.layout.TabContainer" region="center" tabStrip="true">
<div dojoType="dijit.layout.ContentPane" title="Contact" selected="true">
some text
</div>
<div dojoType="dijit.layout.ContentPane" title="Imprint" selected="true">
some text
</div>
I want to place a link to autmatically be navigated to the title "Imprint".
Can someone help?
Thanks a lot and all the best TTP
You can either select it from javascript, or generate the markup for the tab from your server with the
selected
attribute totrue
(you'll need to set the other tofalse
). This second alternative, depends on your server technology.For the first option, add ids to the container and tabs and select the tab when the page finished loading. Something like:
If you want to dynamically select either tab, you'll need to pass some kind of parameter in the URL to your page. You can use a query parameter (variables after the
?
symbol) or a hash fragment (anything after#
). Query parameter you can read both from the server and from javascript. Hash fragments, only from javascript.You can access those parameters by inspecting the
location
object. For example, using a hash fragment, you'd link to your page likehttp://host/page.html#imprint
. Then in the<script>
tag above:For query parameters, also see
dojo.queryToObject()
.