A Simple Example

In this example, we bookmarks each tab selection.

<window id="wnd" title="Bookmark Demo" width="400px" border="normal">
    <zscript>    
    page.addEventListener("onBookmarkChanged",    
        new EventListener() {        
                            public void onEvent(Event event) throws UiException {try {                            
                    wnd.getFellow(wnd.desktop.bookmark).setSelected(true);                    
                } catch (ComponentNotFoundException ex) {                
                    tab1.setSelected(true);                    
                }                
            }            
        });        
    </zscript>    

    <tabbox id="tbox" width="100%" onSelect="desktop.bookmark = self.selectedTab.id">    
        <tabs>        
            <tab id="tab1" label="Tab 1"/>            
            <tab id="tab2" label="Tab 2"/>            
            <tab id="tab3" label="Tab 3"/>            
        </tabs>        
        <tabpanels>        
            <tabpanel>This is panel 1</tabpanel>            
            <tabpanel>This is panel 2</tabpanel>            
            <tabpanel>This is panel 3</tabpanel>            
        </tabpanels>        
    </tabbox>    
</window>