Bambookit Home    Bambookit GUI Tutorial

Back    Next   

V. Bambookit Reference

Chapter 23. Frame Support




Frames


Method Signature

setTarget="string"
[string] any alphanumeric value is valid.

One of the ways of using frames is to open each Bambookit XML scripted application view in a different frame on the web page.

This feature is very useful if you need to enhance your web page with Bambookit controls. Let's say you created a tree to be used to navigate your web site and placed the tree in the left frame. As you click on the nodes in the tree you want the new page to be loaded in the right frame so you can continue to navigate through your site from the tree on the left.

Examples

In this example we will be creating a Web page containing four frames: top frame, and a,b,c frames placed as a columns below. We will be placing the Bambookit main application in the top frame. This application will contain three buttons (Frame A,B,C), clicking on each of them will open application views (a,c) in frames A,C, and html page in Frame B.

To view the application example click here

First we will create HTML page containing frames: <frameset rows="78,*" frameborder=1 framespacing=0> <frame src="top.html" name="top" scrolling=no> <frameset cols="*,*,*"> <frame src="a.html" name="a"> <frame src="b.html" name="b"> <frame src="c.html" name="c"> </frameset> </frameset> The HTML page will appear as following:



The top.html file source: <html> <body> <center> <applet codebase="../../" archive="bamboo_b388.jar" code="Loader.class" width=400 height=60> <param name="loadgui" value="top.xml"> </applet> </center> </body> </html> View the top.xml source. Note the setTarget method set for each button. The setTarget name is the same as the Frame's name set in the frameset above: <?xml version="1.0"?> <Widget setSize="400,60" setBackground="dfd6f7"> <Button setShape="5,10,120,25" setLabel="Frame A" setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" setOpaque="false" setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" setFocusTraversable="false" setForegroundSelect="black" setGroup="actions" setTarget="a" addActionTarget="this,action,loadUrl='frameA.html'"/> <Button setShape="130,10,120,25" setLabel="Frame B" setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" setOpaque="false" setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" setFocusTraversable="false" setForegroundSelect="black" setGroup="actions" setTarget="b" addActionTarget="this,action,loadUrl='http://www.google.com'"/> <Button setShape="255,10,120,25" setLabel="Frame C" setRollover="true" setFontStyle="underline" setBackgroundHighlight="false" setOpaque="false" setBorder="roundraisedthin" setForegroundHighlight="black" setForeground="black" setSticky="true" setFocusTraversable="false" setForegroundSelect="black" setGroup="actions" setTarget="c" addActionTarget="this,action,loadUrl='frameC.html'"/> </Widget> Button "Frame A" calls the HTMl file "frameA.html". View frameA.html source: <html> <body> <center> <applet codebase="../../" archive="bamboo_b388.jar" code="Loader.class" width=200 height=300> <param name="loadgui" value="frameA.xml"> </applet> </center> </body> </html> frameA.html calls frameA.xml file. View frameA.xml source: <?xml version="1.0"?> <Widget setSize="200,300" setBackground="dfd6f7" setLayout="iconviewy,120,25,0"> <Widget setLabel="Frame A"/> <Button setLabel="Button2"/> <Button setLabel="Button3"/> <Button setLabel="Button4"/> <Button setLabel="Button5"/> <Button setLabel="Button6"/> <Button setLabel="Button7"/> <Button setLabel="Button8"/> <Button setLabel="Button9"/> <Button setLabel="Button10"/> </Widget> Button "Frame B" calls url address: www.google.com. Button "Frame C" calles html file "frameC.html", which in turn calls xml file "frameC.xml". View frameC.html source: <html> <body> <center> <applet codebase="../../" archive="bamboo_b388.jar" code="Loader.class" width=200 height=300> <param name="loadgui" value="frameC.xml"> </applet> </center> </body> </html> View frameC.xml source: <?xml version="1.0"?> <Widget setSize="200,300" setBackground="dfd6f7" setLayout="iconviewy,120,25,0"> <Widget setLabel="Frame C"/> <Button setLabel="Button2"/> <Button setLabel="Button3"/> <Button setLabel="Button4"/> <Button setLabel="Button5"/> <Button setLabel="Button6"/> <Button setLabel="Button7"/> <Button setLabel="Button8"/> <Button setLabel="Button9"/> <Button setLabel="Button10"/> </Widget>

Back    Next