Bambookit Home    Bambookit GUI Tutorial

Back    Next   

V. Bambookit Reference

Chapter 22. Create Links




Create links


Method Signature

addActionTarget="string name,action,loadUrl='file name'"
[string name] any alphanumeric value is valid. The name of the button from which the document is called. If the name is not supplied, 'this' is used to indicate that action will be performed on this widget.
[action] action event in Bambookit GUI.
[loadUrl='file name'] file name, for example, documentname.html, documentname.xml, documentname.doc etc..

Bambookit's action event allows to link to another document. Actions can be performed on the buttons, tabs, edit, checkboxes and radio buttons, and items in the listbox and tree. The most comon action performed on the button is to call a web page through the use of 'loadUrl' parameter of addActionTarget property.

Examples

In the following example we will be creating three buttons and will link them to a web page (www.google.com), xml file ( create_links.xml), and word document (market_planning.doc)

See create_links.XML source below for the applet above. In the line 2 the addActionTarget property is used to link to a web page: addActionTarget="this,action,loadUrl='http://www.google.com'"
In the line 6 the addActionTarget property is used to link to a XML file: addActionTarget="this,action,loadUrl='create_links.xml'"
In the line 10 the addActionTarget property is used to link to a word document: addActionTarget="this,action,loadUrl='market_planning.doc'" In the line 14 the addActionTarget property is used for 'mailto' link: addActionTarget="this,action,loadUrl='mailto:info@bambookit.com?subject=sales'" The mailto protocol can be used to automatically send an email message to the recipient from within the browser.

XML Source: <?xml version="1.0"?> 1<Widget setSize="510,60" setBackground="dfd6f7"> 2 <Button setShape="5,10,120,25" addActionTarget="this,action,loadUrl='http://www.google.com'" setLabel="www.google.com" 3 setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" setOpaque="false" 4 setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" 5 setFocusTraversable="false" setForegroundSelect="black" setGroup="actions"/> 6 <Button setShape="130,10,120,25" addActionTarget="this,action,loadUrl='create_links.xml'" setLabel="create_links.xml" 7 setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" setOpaque="false" 8 setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" 9 setFocusTraversable="false" setForegroundSelect="black" setGroup="actions"/> 10 <Button setShape="255,10,120,25" addActionTarget="this,action,loadUrl='market_planning.doc'" 11 setLabel="market_planning.doc" setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" 12 setOpaque="false" setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" 13 setFocusTraversable="false" setForegroundSelect="black" setGroup="actions"/> 14 <Button setShape="380,10,120,25" addActionTarget="this,action,loadUrl='mailto:info@bambookit.com?subject=sales'" 15 setLabel="mailto" setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" 16 setOpaque="false" setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" 17 setFocusTraversable="false" setForegroundSelect="black" setGroup="actions"/> 18</Widget>